In class homework for Udacity CS215, Intro to Algorithms