Here's another binary search, this one without an explicit test for a match in the loop, and without a variable named found. We're looking for number x in an array T, and then we'll print the corresponding element of an array N. The idea (trick?) of this algorithm is that once the pointers have crossed, the left-hand one must point at the desired entry, if it's there. We assume here that if (b+e)/2 isn't an integer, the extra .5 will be thrown away. So for example (16 + 17)/2 = 16 Get the arrays T and N and the size n Get incoming phone number x b <-- 1; e <-- n; while (b <= e) { m <-- (b+e)/2; if (T[m] < x) b <-- m+1; else e <-- m-1; } if (T[b] = x) Print N[b]; else Print "Sorry";