I think it can be done in O(n) but the auxilliary space required will be more... in the solution which i have got its in the order of 2n
On Wed, May 18, 2011 at 4:44 PM, Kunal Patil <kp101...@gmail.com> wrote: > @Amit: Ohh..Your test case is correct but not my solution..[?] > It only works if it is guaranteed that one end will be at the extreme of > the array ! (UseLess ! [?]) > Sorry folks... > So can anybody prove that O(n) solution does not exist for this problem? > [?] > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@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. > -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=100000655377926 * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@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.
<<35F.gif>>
<<33A.gif>>
<<320.gif>>