- What is the worst-case time complexity of QuickSort?
A
O(n log n)
B
O(n²)
C
O(n)
D
O(log n)
Answer and explanation
Correct Answer: B — O(n²)
QuickSort has O(n²) worst-case when the pivot is always the smallest or largest element.
ObjectiveMCQ
Print Protected
This page is protected for print. Use the website to view the content.
Browse the question list for Sorting in Algorithms, GATE CSE 2025.
1 questions · Page 1 of 1
O(n log n)
O(n²)
O(n)
O(log n)
QuickSort has O(n²) worst-case when the pivot is always the smallest or largest element.