programming assignment for week one of the coursera algorithms class.