@Yasir: Yups...I also have the same algo...
Just to improvise your solution, you need not do binary search on both sides
of the pivot.
Just check End points (min-max) of the both sub-array to decide which side
to do a binary search..This works in the case of duplicate elements too.
for e.g.
2 5
Yeah got it. Thanks :)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/NAqtuyQmehgJ.
To post to this group, send email to algogeeks@googlegroups.com.
To
nope it will not work
top kya lower part bhi sorted hai..
like 7 8 9 1 2 3 4 5 6
do it with this i/p... it will fail
ur algo will do same thing for 8 and 4
FAIL !!!
On Fri, Aug 12, 2011 at 9:27 PM, KK kunalkapadi...@gmail.com wrote:
Check this out
//But this and fails for input
how abt http://ideone.com/lN2og ??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/pZdvFb_t2b4J.
To post to this group, send email to