Data Structures, Algorithms, Java, Big O Notation, Searching And Sorting.
check covers all cases , so need to check // for mid=lo-(high-low)/2 while (high - low > 1) { int mid = (high + low) / 2; if (arr[mid] < searched) { low = mid + 1; } else { high = mid; } } if (arr[low] == searched) { System.out.println("Found At Index " + low ); } else if arr[high] == searched) {