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 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.