code for intro to algo (6.006 mirror)