CM225C Design and Analysis of Algorithms