Asymptotic analysis
How do I compare two algorithms without running them?
MIT OCW
Erik Demaine. Full lectures, problem sets and solutions.
Core · Module 03
The core intellectual content of computer science: how to organise data so that questions about it become cheap.
By the end of this module
You can choose the right structure for a problem and justify the choice with a complexity argument.
How do I compare two algorithms without running them?
MIT OCW
Erik Demaine. Full lectures, problem sets and solutions.
What question is each structure optimised to answer quickly?
NUS
Step through every structure and algorithm, one operation at a time.
Why can't comparison sorting beat n log n?
How many real problems are secretly graph problems?
When is it safe to commit to a local choice?
Check yourself
Every answer comes with the reasoning, not just a verdict. Getting one wrong and reading why is the point.
01Hash table lookup is O(1) on average but O(n) in the worst case because:
02Comparison-based sorting cannot beat O(n log n) because:
03Dynamic programming applies when a problem has: