Use ternary search to find the minimum number. (In this case 1)
Then you have two sorted arrays, one ascending and one descending.
Now, you can apply binary search. First, check the number with the
last element and the first element and chose the appropriate array for
searching.

Time complexity: O(log n)
Space complexity: O(1).

On Jun 10, 9:06 pm, coder dumca <[email protected]> wrote:
> hi frndz
>
> given an array which is circularly sorted  like
>
> 6  ,7    ,8   ,1   ,2   ,3  ,4    ,5
>  search a  given number.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to