Algorithm Implementation Assignment#5 Solution