Notes and code from Coursera Algorithm 1