Theory of Algorithms HW2