Coding Exercise for Algorithms