Week 3 programming assignment of Algorithms, Part 1 from Princeton University in Coursera.