|
Ah, so we just report the value of B and think no more on it. The idea is that a programmer using this function might do the following:
/* begin code */
B = binsearch(A, 1, size_of_A - 1);
if (B!=0 && 5==A[B])
printf("5 is in the array\n");
else
printf("5 is not in the array\n");
/* end code */
Is that the right idea? roni |
Merely compute B by Mike O'Donnell, 2001, Oct 20
to: