@Jalaj: What is the work for each of the operations? I presume that get is O(1), but don't know if reverse is O(1) or O(end-start).
Dave On Feb 10, 12:07 am, jalaj jaiswal <[email protected]> wrote: > sort the input array. only following operations on array is allowed: > 1)get(index) -gets the element at that index > 2)reverse(int start,int end) - example reverse(1,3) for the array > [1,2,3,4,5] will return [1,4,3,2,5] > > better then nlogn > > -- > With Regards, > *Jalaj Jaiswal* (+919019947895) > Software developer, Cisco Systems > Final Year Undergraduate, > IIIT ALLAHABAD -- 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.
