Algorithm Homework 2