my homework for princeton coursera algs1 class