Code I write for class: Algorithm (https://class.coursera.org/algs4partI-003/class/index)