Skip to content
All tags

#asymptotic-analysis

1 posts

Stanford CS161 Lecture 2: From an InsertionSort Proof to MergeSort's n log n

Lecture 2 turns 'fast' into a worst-case bound that can be proved. A loop invariant establishes InsertionSort's correctness while its worst case is n²; a recursion invariant and O(n) work per level give MergeSort O(n log n).