Elements of Programming Interviews - Java
Problem - Search a cyclically sorted array
Variant 2 - Design an O(logn) algorithm for finding the position of an element k in cyclically sorted array.
I have an idea - find the smallest element (which will also give the location of largest element) and use the indices to find the mid and perform binary search. The problem with this approach is figuring out the index of mid and updating it with each iteration.
Any help is appreciated!