3 ms·
Given that the list is sorted you can just modify the basic binary search to do what your want. Choose the middle and then compare the index with the value - de
by dangoldin 18y ago
Given that the list is sorted you can just modify the basic binary search to do what your want. Choose the middle and then compare the index with the value - depending on the relationship look to the left or right and repeat.