use pancake sorting
http://www.youtube.com/watch?v=kk-_DDgoXfk Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Sun, Jun 12, 2011 at 2:29 PM, ross <[email protected]> wrote: > There is an array in an external system (i.e. u cannot access the > array elements directly). > > The system exposes 3 functions of O(1) - (assume) : > length() - returns the length of the array. > get(i) - returns the element at index i. > reverse(i,j) - reverses the elements in the array from index i to > index j (both indexes inclusive). > sort the array in the best possible way using only these 3 operations? > > -- > 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. > > -- 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.
