Introduction to Algorithms 4th Edition by Thomas H. Cormen