while increasing ... we have to use insertion sort which is in place algo .. while decreasing... any way that is sorted one .. so no need to maintain ... But it takes O(n^2) time ..
On Wed, Aug 31, 2011 at 1:58 AM, Navneet Gupta <[email protected]>wrote: > Given an array of size n wherein elements keep on increasing > monotically upto a certain location after which they keep on > decreasing monotically, then again keep on increasing, then decreasing > again and so on. Sort the array in place (ie. using only O(1) extra > memory) > > -- > Regards, > Navneet > > -- > 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. > > -- **Please do not print this e-mail until urgent requirement. Go Green!! Save Papers <=> Save Trees *BharatKumar Bagana* **http://www.google.com/profiles/bagana.bharatkumar<http://www.google.com/profiles/bagana.bharatkumar> * Mobile +91 8056127652* <[email protected]> -- 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.
