Lecture 32: More Quick Sort, Sorting Summary

11/10/2020

Partition Sort a.k.a. Quicksort

Avoiding the Worst Case

Philosophy 1: Randomness (Preferred Approach)

Philosophy 2a: Smarter Pivot Selection (constant time pivot pick)

Philosophy 2b: Smarter Pivot Selection (linear time pivot pick)

Philosophy 3: Introspection

Sorting Summary (so far)

Quicksort Flavors

Tony Hoare's In-place Partitioning Scheme

What if we don't want randomness?

Median Identification

Quick Select

The Selection Problem

Quick Select

Worst Case Performance of Quick Select

Expected Performance

Quicksort with Quickselect

Stability, Adaptiveness, Optimization

Other Desirable Sorting Properties: Stability

Sorting Stability

Stability

Optimizing Sorts

Arrays.sort

Sorting Summary

Sorting Landscape

Sorting vs Searching