Recurrences and recursion trees
A recursive algorithm's running time obeys a recurrence such as $T(n) = 2T(n/2) + n$, and adding up the work level by level in its recursion tree solves it, $n \log_2 n$ here, $\log_2 n$ for $T(n/2) + 1$ and about $\frac{n^2}{2}$ for $T(n-1) + n$.