fixed binary search algorithm