BinarySearch( A, value ) { low = 0 high = N + 1 p = (high+low)/2 while ( low < high ) { if ( A[p] > value ) high = p else if ( A[p] < value ) low = p else return p p = (high+low)/2 } return not_found }