another binary search without recursion