+ 2
The 1st and 2nd number doesnt appear to be found. Pls help me. (Binary Search)
2 Answers
+ 8
The reason why it isn't working is primarily because binary search algorithm requires your set of data to be sorted. The data in the array you provided is unsorted.
Your code works fine after I rearranged the array values.
+ 2
Thanks, I didn't know that it must be sorted first. Anyways, great help!