Every lesson in the CS3000 Algorithms slide course, in full text: 20 decks, 2627 slides.
Asymptotic Notation (Big-O, Big-Omega, Big-Theta)This deck covers Big-O, Big-Omega, and Big-Theta notation as CS3000 uses them. It explains why we measure growth rather than exact time, gives the formal definitions in terms of a constant and a threshold, shows how to construct a Big-O proof by exhibiting a specific c and n0, and lays out the standard growth-rate hierarchy from constant to factorial. It targets four real misconceptions: treating Big-O as a synonym for worst case, treating constant-factor multiples as different classes, reporting a loose Big-O when a tight Big-Theta is actually known, and assuming that an algorithm with a larger Big-O is always slower on the small inputs you actually run.
Binary Search & Analyzing LoopsThis deck traces binary search step by step on a concrete sorted array, gives the loop invariant that proves it correct with all three obligations spelled out, explains why halving the range gives logarithmic running time, and states the general rule for counting any loop's running time. It targets the off-by-one that never shrinks the range, trusting binary search on unsorted data, mixing up linear with logarithmic growth, and invariants that are stated but not actually preserved.
Dynamic Programming II: Knapsack, Coin Change & Rod CuttingThis deck covers 0/1 knapsack, coin change in both its minimum-coin and combination-counting forms, and rod cutting, making the setup explicit every time: define the state in words, write the take-or-skip or best-choice recurrence, pin down the base case, fill the table in dependency order, and reconstruct the items, coins, or cuts actually chosen. It targets four real misconceptions: using a best-ratio greedy strategy on 0/1 knapsack, accidentally reusing a single-copy item, using a greedy coin heuristic on a coin system where it overshoots the true minimum, and an off-by-one in the table's capacity or amount dimension. Every recurrence, table trace, and reconstruction was verified by hand and cross-checked against brute-force enumeration.
Dynamic Programming I: MemoizationThis deck gives the two ingredients that make dynamic programming apply, then shows the naive exponential recursion for Fibonacci and why it recomputes the same values. It presents the two fixes - top-down memoization and bottom-up tabulation - through a repeatable method for defining the state, writing the recurrence, and choosing the base cases, with Fibonacci and climbing stairs fully hand-traced. It targets four real misconceptions: reaching for dynamic programming when the subproblems never actually overlap, a wrong or missing base case that corrupts an entire table, a memo that is written but never checked before recursing, and a state defined too ambiguously to support a clean recurrence.
Dynamic Programming III: LIS, LCS & Edit DistanceThis deck sets up three classic sequence dynamic programs from scratch: Longest Increasing Subsequence, Longest Common Subsequence, and Edit Distance. It emphasizes defining the state in words, choosing the correct base row and column, writing the match-or-mismatch recurrence, and tracing the grid to read back the actual answer. It targets confusing a subsequence with a substring, mis-initializing the Edit Distance base case to zero, tracing the answer back from the wrong cell or in the wrong direction, and thinking that LIS requires contiguous elements.
Graph Basics: DAGs, Trees & BSTsThis deck covers the vocabulary and structures that every graph algorithm builds on: vertices and edges, directed against undirected graphs, degree and the handshake lemma, paths, cycles, and connectivity, the trade-offs between an adjacency list and an adjacency matrix, and DAGs, trees, and binary search trees. It targets the beliefs that a matrix is always the better representation, that any tree or any binary tree behaves like a BST, and that a DAG must be connected or cannot have two paths between the same nodes, along with sloppy degree counting.
Graph Traversal: BFS & DFSThis deck covers breadth-first and depth-first search on graphs stored as adjacency lists. It gives a full BFS trace with a queue and shortest-path parent pointers, explains why BFS finds shortest paths only when every edge costs the same, and gives a full DFS trace with discovery and finish times together with the tree, back, forward, and cross edge classification that DFS reveals. It then explains why both run in time proportional to the number of vertices plus edges rather than to the number of vertices squared. It targets four real misconceptions: trusting BFS shortest paths on weighted graphs, forgetting the visited set, assuming quadratic running time, and mixing up which data structure belongs to which traversal.
Greedy Algorithms & Exchange ArgumentsThis deck explains what a greedy algorithm is and traces two of them: interval scheduling by earliest finish time, and fractional knapsack by highest value-to-weight ratio. It then gives the two standard ways to prove a greedy algorithm optimal, greedy-stays-ahead and the exchange argument. It targets the beginner's biggest gap, which is getting a proof started, along with the misconceptions that greedy always works, that any scheduling criterion is as good as another, that a few working examples count as a proof, and that an exchange can be made carelessly.
Huffman CodingThis deck shows how Huffman coding builds an optimal variable-length, prefix-free code from symbol frequencies. It traces the merge-the-two-smallest algorithm by hand on a six-symbol alphabet, encodes and decodes a message, and sketches the exchange argument for why the greedy strategy is provably optimal. It targets codes that are not prefix-free, merging the wrong nodes or forgetting to reinsert the merged node, the reversal that would give frequent symbols longer codes, and the false belief that fixed-length coding is never worse than Huffman.
Maximum Sum SubarrayThis deck works the maximum sum subarray problem three ways: by brute force, by divide-and-conquer including the crossing subarray case, and by Kadane's linear scan. It targets confusing a subarray with a subsequence, forgetting the crossing case in divide-and-conquer, resetting Kadane's running sum to zero on an all-negative array, and off-by-one errors when reporting the start and end indices. Every trace is re-derived by hand on the same running example, so all three methods check against each other.
Merge Sort & the Master TheoremThis deck traces merge sort end to end, explains why the merge step is linear, sets up the merge sort recurrence, and works the Master Theorem's three cases by comparing the extra work f(n) against the watershed function n^log_b(a). It targets swapping a and b, mis-comparing f(n) to the watershed, assuming the merge step is free, and force-fitting recurrences - those with log-factor gaps or unequal splits - that do not satisfy the theorem's hypotheses.
Minimum Spanning Trees: Prim & KruskalThis deck explains what a minimum spanning tree is, then gives the cut property and the cycle property that make greedy MST algorithms provably correct. It includes full hand-traced runs of Prim's and Kruskal's algorithms, the latter with union-find, along with their running times. It targets the misconceptions that an MST is always unique, that it is the same thing as a shortest-path tree, that Kruskal never needs a cycle check, and that union-find stores weights or paths rather than connectivity alone.
Network Flow: Max-Flow Min-CutThis deck covers flow networks and the two rules a valid flow obeys, residual graphs and why augmenting paths need back edges, the Ford-Fulkerson and Edmonds-Karp algorithms, the max-flow min-cut theorem, and the reduction from bipartite matching. It targets four real misconceptions: exceeding an edge's capacity, forgetting the residual back edges, confusing the value of the max flow with the capacity of the min cut, and assuming that a single greedy highest-capacity path finishes the job. Every trace was verified by hand.
Proof by ContradictionThis deck shows how to start, run, and close a proof by contradiction: recognizing when it fits, negating a claim correctly - including flipping the quantifiers - and reasoning through to a genuine impossibility. It works the irrationality of the square root of 2, the infinitude of the primes, and a sketch of a greedy exchange argument. It targets four real misconceptions: negating "for all" incorrectly, confusing contradiction with contrapositive, declaring victory without a real impossibility, and assuming the claim instead of its negation.
Proof by InductionThis deck is a from-scratch guide to STARTING an induction proof, not merely following one. It covers recognizing when a claim needs induction, writing the base case, the inductive hypothesis, and the inductive step, and choosing between weak and strong induction. The worked proofs cover a summation identity, an inequality, a divisibility claim, a strong-induction postage argument, and two recursive-structure proofs - a recursive sum function and binary-tree leaf counts - which connect induction to recursive algorithms. It targets six real mistakes: asserting the conclusion instead of deriving it, picking the wrong base case, writing a step that never uses the hypothesis, misstating the hypothesis as the whole universal claim, proving something weaker than what was required, and using weak induction where strong induction is needed.
Quicksort, Selection & Median of MediansThis deck covers quicksort's partition step and its recursion, the best, average, and worst-case running times, and the sorted input that triggers the worst case. It then explains randomized pivots and why they make the bad case vanishingly unlikely, introduces the selection problem and quickselect, and gives the median-of-medians pivot rule, using groups of five, that guarantees linear worst-case selection. It targets the myths that quicksort is always n log n, that selection requires a full sort, and that the choice of pivot does not matter for the worst case, and it explains why groups of five in particular are used.
Reading Math Notation, Sets & FunctionsThis deck teaches how to read the symbolic vocabulary the rest of CS3000 is written in. It covers sets and set-builder notation, the difference between element-of and subset-of, union and intersection, ordered pairs and the Cartesian product, and functions with their domain and codomain. It then separates floor from ceiling from rounding, reads summation and product notation as accumulating loops, treats logarithms as the inverse of exponents, and ends with the for-all and there-exists quantifiers and how to set up each kind of proof. It targets reading symbols phonetically without meaning, confusing element-of with subset-of, mistaking floor for rounding, being intimidated by summation notation, and swapping the order of quantifiers.
Recurrences & Recursion TreesThis deck shows how to turn a recursive algorithm into a recurrence and then solve it three ways: the recursion-tree method, which multiplies the work per level by the number of levels; unrolling by repeated substitution; and the substitution method's proof by induction. It covers both equal and unequal subproblem sizes. It targets forgetting the non-recursive work, miscounting the tree depth or the nodes per level, guessing a bound without ever verifying it, and treating an unequal split as though it were balanced.
Shortest Paths: Dijkstra & Bellman-FordThis deck builds single-source shortest paths from one shared primitive, edge relaxation. It traces Dijkstra's algorithm by hand with a priority queue and explains why its greedy choice is safe only for non-negative weights, then covers Bellman-Ford's V-1 rounds of relaxation and its negative-cycle detection. It targets the traps of trusting Dijkstra with a negative edge, relaxing in the wrong direction, misjudging why V-1 rounds are needed, and reviving a vertex that has already been settled.
Topological Sort & Strongly Connected ComponentsThis deck gives two ways to linearize a DAG - DFS finish-time order, and Kahn's in-degree removal - then shows how strongly connected components are found by Kosaraju's two-pass reverse-graph idea, and why the condensation of any graph's SCCs is always itself a DAG. It targets trying to sort a cyclic graph, the false belief that a topological order is unique, mixing up a directed SCC with an undirected connected component, and forgetting to reverse the graph in Kosaraju's algorithm. Every trace was verified by hand.
Want this taught 1-on-1? Alexander tutors CS3000 Algorithms — $55/session, free consultation.