Skip to Content

Quick Sort (Coming Soon)

Quick Sort is an efficient, divide-and-conquer sorting algorithm. It works by selecting a ‘pivot’ element and partitioning the other elements into two sub-arrays according to whether they are less than or greater than the pivot.

Complexity

TypeComplexity
Time (Worst)O(n2)O(n^2)
Time (Average)O(nlogn)O(n \log n)
Time (Best)O(nlogn)O(n \log n)
SpaceO(logn)O(\log n)

Concepts

  • Pivot Selection: Choosing the right pivot is crucial for performance.
  • Partitioning: Reordering the array so that elements < pivot come before elements > pivot.
Last updated on