Question: Design a decrease and conquer sorting algorithm that can only change array elements by reversing the order of elements whose indexes are in a certain

Design a decrease and conquer sorting algorithm that can only change array elements by reversing the order of elements whose indexes are in a certain interval. For example, if the original array is: 50, 80, 20, 40, 30, 100 , then reversing the order of elements at indexes in the interval [0,2], results in the array: 20, 80,50,40, 30,100 . For this array, one more reversal ([1,4]) will result in a sorted array. What is the worst-case efficiency, measured in number of reversals, of your algorithm? Prove your result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
