Computer ScienceAdvanced

How to make a program fast enough, and how to know that it is. Asymptotics, divide and conquer, greedy, dynamic programming, graphs, flow, strings, and what to do when a problem turns out to be intractable. Taught in Python or C++, your choice.

Contents

Algorithms

1

Foundations: correctness and asymptotic analysis

Two questions follow every algorithm you will ever write: is it right, and what does it cost? This section answers both from first principles. You will state a problem precisely enough to argue about, prove a loop right with an invariant and a recursion right by induction, count operations honestly, and then learn the notation that throws away everything about that count except how it grows. It finishes with the working habits: reading a constraint backwards to a target running time, measuring growth on a real machine, and naming the brute force before trying to beat it.

0/22

Divide and conquer, and recurrences

Opens once you finish Foundations: correctness and asymptotic analysis, including its quiz.

locked

Sorting, comparators, and order statistics

Opens once you finish Divide and conquer, and recurrences, including its quiz.

locked

Binary Search and Search on the Answer

Opens once you finish Sorting, comparators, and order statistics, including its quiz.

locked

Randomized algorithms and probabilistic analysis

Opens once you finish Binary Search and Search on the Answer, including its quiz.

locked

Amortised Analysis and Linear-Scan Techniques

Opens once you finish Randomized algorithms and probabilistic analysis, including its quiz.

locked

Prefix Sums, Difference Arrays, and Range Queries

Opens once you finish Amortised Analysis and Linear-Scan Techniques, including its quiz.

locked

Greedy Algorithms, Intervals, Sweep Line, and Online Choice

Opens once you finish Prefix Sums, Difference Arrays, and Range Queries, including its quiz.

locked

Recursion, Backtracking, and Combinatorial Search

Opens once you finish Greedy Algorithms, Intervals, Sweep Line, and Online Choice, including its quiz.

locked

Dynamic programming

Opens once you finish Recursion, Backtracking, and Combinatorial Search, including its quiz.

locked

Graph Search, Grids, and Topological Order

Opens once you finish Dynamic programming, including its quiz.

locked

Union-Find, Minimum Spanning Trees, and Shortest Paths

Opens once you finish Graph Search, Grids, and Topological Order, including its quiz.

locked

Network Flow, Matching, and Linear Programming

Opens once you finish Union-Find, Minimum Spanning Trees, and Shortest Paths, including its quiz.

locked

String Algorithms and Tries

Opens once you finish Network Flow, Matching, and Linear Programming, including its quiz.

locked

NP-completeness, reductions, and coping with intractability

Opens once you finish String Algorithms and Tries, including its quiz.

locked

Bitwise, Numeric, and Specialized Algorithms

Opens once you finish NP-completeness, reductions, and coping with intractability, including its quiz.

locked

Algorithms unit exam

Opens once every section is finished and every quiz is passed.