first find out the element around which array is rotated. i.e find the first element of original array( using modified binary search ) then compare the element to be searched with the first elent of given array, if it is greater than it then binary search in first half of array else in second half of array.
3 4 5 6 1 2 this array;s origina first elent is 1 (find it using binary search(modified) then compare the elent to be searched with 3 , if greater then it then search in first half using binary search, else search in second half On Sun, Aug 8, 2010 at 2:11 AM, AlgoBoy <manjunath.n...@gmail.com> wrote: > is there a way to apply a binary search on a sorted array...with a > catch... the array is rotated k times clockwise > > Example...4,5,1,2,3... > > I heard a binary search is possible.. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- With Regards, Jalaj Jaiswal +919026283397 B.TECH IT IIIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.