Quicksort

Quick sort is a divide-and-conquer sorting algorithm that selects a “pivot” element from an array, partitions the remaining elements into two sub-arrays (elements less than the pivot and elements greater than the pivot), and then recursively sorts the sub-arrays.

  • Time complexity is Quadratic, i.e. O(n^2)
  • Space complexity is Linearithmic, i.e. O(n log(n))