Data Structures & Algorithms · Revision notes
Asymptotic Analysis & Complexity
Asymptotic analysis measures how running time and memory grow with input size n, ignoring machine-specific constants. Big-O (upper bound), Omega (lower bound) and Theta (tight bound) are the language of every algorithm comparison; recursion adds call-stack space.
Quick revision
- Theta = O and Omega; drop constants and lower terms
- Sequential: add (max); nested: multiply; halving/doubling: log
- Master: compare n^(log_b a) with f(n)
- Space = auxiliary + recursion depth; naive Fibonacci time 2^n, stack n