f(x) = O(g(x)) iff |f(x)| ≤ c|g(x)| for x → ∞ • We care about asymptotic growth rate - f grows at most as fast as g • Run time is O(f(n)) - n is the length of input
trees (i.e. directed graphs - nested data) • For simple maps and vectors you still have to copy everything • Viable solution (e.g. React immutability helpers)
factor is 32, so O(log32 n) • For depth 5, you can fit 33 554 432 items • Path copying in < 5 steps ~ constant • It’s a tree, so structural sharing works