Hard
Binary Search
Write
search(sorted_list, x) that returns the index of x using binary search, or -1. Read a sorted line of integers and x.Input
Sorted integers, then x.
Output
An index or -1.
Sample 1
Input
1 3 5 7 9 7
Output
3
Sample 2
Input
1 3 5 7 9 4
Output
-1
Output appears here