Question: Write a class with a method called splitSearch with: - 2 parameters - a sorted array of int - an int target - algorithm: -.
Write a class with a method called splitSearch with: - 2 parameters - a sorted array of int - an int target - algorithm: -. create a variable called low and set it to the first index of the array ..- create a variable called high and set it to the last index of the array ..- loop until low is greater than high ....- find the midpoint index between low and high if the midpoint value matches the target, return true if the target is greater than the midpoint value set the low variable to mid +1 if the target is less than the midpoint value set the high variable to mid 1 when the loop ends, return false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
