What is the complexity of Quick Sort's worst case?

Updated Apr 28, 2026

Short answer

O(n^2), occurring when the pivot is consistently the smallest or largest element.

Deep explanation

Medium-level D&C explores specific mathematical optimizations and trade-offs. O(n^2), occurring when the pivot is consistently the smallest or largest element.

Real-world example

Efficiently multiplying very large numbers in cryptographic systems.

Common mistakes

  • Applying Master Theorem to recurrences that don't fit the standard format.

Follow-up questions

  • What happens if a < 1?

More Divide & Conquer interview questions

View all →