quicksort
Divide-and-conquer algorithm
Quicksort is a sorting algorithm that works by selecting a pivot element and partitioning the remaining elements into two groups—those less than the pivot and those greater—then recursively sorting each group.
It's among the fastest general-purpose sorting methods in practice, though its worst-case performance depends on pivot selection: The library uses quicksort for most array operations.
Point of rotation
- partitionBarrier separating spaces
- in-placeProperly positioned already
- three-wayInvolving three participants
- randomizedArranged by chance
sublists · comparator · swap · sentinel
Contiguous sequence within array
- divideSeparate into parts
- conquerOvercome by force
- subproblemDivided portion of challenge
- depth-firstExhausts branches before siblings
Ordered collection or display
pointer · iteration · in-place · sentinel · boundary · threshold · cutoff · vectorized
Most unfavorable outcome imaginable
- quadraticInvolving squared terms
- logarithmicBased on exponents
- depthDistance below surface
- amortizedGradually written off
pivot
Point of rotation
- partitionBarrier separating spaces
- in-placeProperly positioned already
- three-wayInvolving three participants
randomized · sublists · comparator · swap · sentinel
subarray
Contiguous sequence within array
- divideSeparate into parts
- conquerOvercome by force
- subproblemDivided portion of challenge
array
Ordered collection or display
swap · pointer · iteration · in-place · sentinel · boundary · threshold · cutoff · vectorized
worst-case
Most unfavorable outcome imaginable
- quadraticInvolving squared terms
- logarithmicBased on exponents
- depthDistance below surface