Question: ****IN JAVA PLEASE***** Write a method called validateAndFind. The method shall take as parameters the following: an array a of ints an int t representing
****IN JAVA PLEASE*****
Write a method called validateAndFind. The method shall take as parameters the following:
an array a of ints
an int t representing a target to find in the array a
the method shall return a boolean statement:
true if the target t, appears in the array
false if otherwise
Additionally, the method shall check if the given array is in ascending order Before it searches the target t into the array a. In case the array is not in order, the method shall throw an exception called IllegalStateException
Your method shall use sequential search using recursion
your solution shall run in a complexity of O(N)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
