$15.00 No: And here is why...
- This tutorial hasn't been purchased yet.
- Posted on Jan 01, 2009 at 7:42:10PM
A:
Preview: ... ts to the end of array. Each iteration you move either Low pointer higher, or High pointer lower. As a result, your remainder of the unsearched array is halved in size (hence binary search). Now, as this process nears the end of the array ( ...
The full tutorial is about 224 words long .
$10.00 Unfortunately, no. Worse, you may never "return"...
- This tutorial was purchased 3 times and rated A- by students like you.
- Posted on Jan 01, 2009 at 8:09:48PM
A:
Preview: ... binary search is pretty clear:<br><br>Start with a sorted list, check the middle "item" and if it is NOT a match, then you cut your list in half (either above or below the middle that you just checked.)<br><br>However, look at the circumstance where your data consists of a 2 element vector, and the "match" you are looking for is the "second" element.<br><br>You come into the code, set up your low and high limits as zero and one, then calculate th "middle". (0+1)=1, divide by 2 is .5, but you are using INTEGER math.. ...
The full tutorial is about 457 words long .