First question, is there any difference between binary search and recursive binary search??? I looked through google and everything but couldnt find any useful info. I did find irritative and recursive but that was it.
and second question:
Given a desired search value of 98 and an array with the following sorted integer values:
Index: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Value: 1, 12, 28, 35, 49, 62, 73, 86, 98, 120
Indicate the comparisons made in a recursive binary search function, as well as the values for each of the following variables: int low, int mid, and int high.
For example:
1st function call: low = 0 high = 9 mid = 4 val[mid] == 98? no comparisons = 1
2nd function call: low = ? high = ? mid = ? val[mid] == 98? comparisons = 2
3rd function call: low = ? high = ? mid = ? val[mid] == 98? comparisons
i know in binary recursive it takes the 1 and last and then divide by 2 and then, if not found in first half, the search looks in second half. so does it mean for 2nd function it will be low of 4, high of 9 and then mid of 6...?
thanks for all your help guys.