Time & Space Complexity (Big-O)
Master Big-O analysis: growth rates, O, Omega and Theta, loops, recurrences and the master theorem, space, amortised analysis and practical optimisation.
What you'll learn
- Explain why algorithms are analysed by growth rate and distinguish best, worst and average cases.
- Use Big-O, Big-Omega and Big-Theta correctly, including formal definitions and simplification rules.
- Derive the complexity of loops, including nested, logarithmic, harmonic and two-pointer patterns.
- Analyse recursive algorithms with recurrences, recursion trees and the master theorem.
- Measure space complexity, including recursion stack space, and reason about time-space trade-offs.
- Apply complexity to data structures, sorting, amortised costs, NP-hardness and real optimisation decisions.
Syllabus
Why We Analyse Algorithms
- Measuring Algorithms Without a Stopwatch
- Counting Operations and Best, Worst and Average Cases
- The Common Growth Rates