Stable Sorting
If the same element is present multiple times, then they retain the original relative order of positions.
In place sorting
Sorting of a data structure does not require any external data structure for storing the intermediate steps.
Quicksort is ___, but not ___.
In place, but not stable.
Mergesort is ___, but not in place.
Stable, but not in place.
Quicksort Worst Case
θ(n^2)
Quicksort Best Case Partitioning
T(n) = θ(n log n)
Quicksort Average Case
θ(n log n)
Pivot Selection Strategies
First or Last Element
Random
Median of 3 (left, right, and center)
Median of Medians.
Do not use quicksort recursively for:
arrays of size smaller than some threshold.