What is the worst-case time complexity of the standard QuickSort algorithm when selecting a poor pivot element on an already sorted array?
AO(n log n)
BO(n)
CO(n²)
DO(log n)
Explanation
QuickSort uses Divide and Conquer. While its average time complexity is O(n log n), choosing an extreme element (smallest or largest) as pivot on a sorted array results in worst-case time complexity of O(n²).
Exam Relevance
- Topic: Data Structures & Algorithms
- Subtopic: Sorting Algorithms & Complexity

No Comments