// function to perform binary search
of an array
int binarySearch( const int b[], int
searchKey, int low,
int high, int size )
{
int middle;
// loop until low subscript is
greater than high subscript
while ( low <= high ) {
// determine middle element of
subarray being searched
middle = ( low + high ) / 2;
// display subarray used in this
loop iteration
printRow( b, low, middle, high, size );