Chris realize his computer couldn't perform accurate comparisons on integers. That is, his computer couldn't evaluate if
a > b
is true or false.
He has a sorted array of integers and he needs to find if the number is within the array. He doesn't want to perform a linear search, so he came up with another idea of Binary Search. Here is the algorithm :
What is the time complexity of this algorithm? Or if you think this algorithm doesn't work, choose the option "This algorithm doesn't work".
Details and Assumptions
< > <= >=
.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
No explanations have been posted yet. Check back later!