Sorting

Quicksort

  1. if the array length is ≤ 1, return the array
  2. take a pivot (last element or any random element and take it out of the array)
  3. iterate through the array
    1. if current element > pivot, put in right array
    2. if current element < pivot, put in left array
  4. return quicksort(leftArray), pivot, quicksort(rightarray)