Learning path
Analysis of algorithms
Measure how running time and memory grow, solve recurrences, reason about average and amortized cost, and prove a loop correct.
About this subject
Analysis of algorithms asks two questions about a procedure: is it correct, and how do its time and memory grow as the input gets larger? Instead of timing one run on one computer, you count operations and compare growth rates with asymptotic notation: O for an upper bound, Ω for a lower bound, and Θ for a tight bound.
This path covers growth rates, recurrences and the master theorem, amortized analysis, best, worst, and average cases, loop invariants for correctness, and the trade-off between time and memory. Each lesson uses a small, complete program that runs on its own. Python has the full sequence. The other languages listed below add lessons that use that language's own idioms and standard library, such as Java threads, C++ smart pointers, C# LINQ, or Node.js streams, and appear only for the topics the language supports. The programs are simplified models chosen to make an idea visible, so they are a foundation for further study rather than a replacement for a full course or for production-grade software.
Before you start: Programming fundamentals and the complexity lesson in data structures and algorithms.
- 1
Python
Readable code for automation, data, and first programs.
Growth rates and asymptotic notation
Count operations to see how logarithmic, linear, and quadratic work grow with input size.
Recurrences and the master theorem
Describe divide-and-conquer cost with a recurrence and check it against its closed form.
Amortized analysis
Show that an occasional expensive step still gives constant average cost per operation.
Best, worst, and average case
Measure comparisons for lucky, unlucky, and typical inputs to the same algorithm.
Correctness with loop invariants
Prove that insertion sort is correct by checking an invariant before every iteration.
Time–space trade-offs with memoization
Spend memory on a cache to turn exponential recursion into linear work.
- 2
C
Learn memory, pointers, and efficient systems programming.
- 3
C++
Build fast applications with modern types and classes.
- 4
Java
Understand object oriented programs and the JVM.
- 5
C#
Build typed applications on .NET.
- 6
JavaScript
Add behavior to the web and build applications.
- 7
TypeScript
JavaScript with static types for dependable code.