Algorithm Implementation Assignment#4 Solution