Question 10590 – Sorting
April 18, 2024Question 8115 – Sorting
April 18, 2024Question 8695 – Sorting
You have an array of n elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is
Correct Answer: A
Question 17 Explanation:
The Worst case time complexity of quick sort is O (n2). This will happen when the elements of the input array are already in order (ascending or descending), irrespective of position of pivot element in array.
O(n2)
O(n log n)
Θ(n logn)
O(n3)
