Homework for Algorithms class