Question 10590 – Sorting
April 18, 2024
Question 8115 – Sorting
April 18, 2024
Question 10590 – Sorting
April 18, 2024
Question 8115 – Sorting
April 18, 2024

Question 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.
A
O(n2)
B
O(n log n)
C
Θ(n log⁡n)
D
O(n3)

Leave a Reply

Your email address will not be published. Required fields are marked *