- What value of q does partition for quick sort return, in case all the elements of the array have same values? myAns: O(n^2)
- quick sort algorithm in case array is already sorted as per requirement. myAns: O(n^2)
- quick sort algorithm in case array is already sorted in the reverse order of the requirement. myAns: O(n log n)
- Suppose partition algorithm used for quick sort portioned the elements into 1-α and α where 0< α ≤1/2, α is constant. Derive the recurrence relation and compute its complexity. myAns: O(n log n)
Please Also answer for:
Discuss Hoare partition algorithm used for portioning the array used in quick sort with suitable example.