Algorithm Implementation Assignment#2 Solution