Programming Exercises from Coursera Algorithms Part 2