
please wait
|
|
|
|
Your program is infinitely recursive. Think about the problem. If the midpoint value is less than what you're looking for, then you need to look in the right half. If the midpoint value is greater than what you're looking for, then you need to look in the left half. Both of the above statements imply recursion, since they are performing the same logic, just on a smaller piece of the array. |
|
|
If the midpoint value is less than what you're looking for, then you need to look in the right half. If the midpoint value is greater than what you're looking for, then you need to look in the left half. Both of the above statements imply recursion, since they are performing the same logic, just on a smaller piece of the array. |
|
|