Skip to content

Sorting

Quicksort

Quicksort partitions an array and then calls itself recursively twice to sort the two resulting subarrays.

  • Time complexity: O(nlog(n))
  • Space complexity: O(n)

排列左右子数组的具体过程 index left, right

选择一个元素,小于的