Introduction to Algorithms - Cormen, Thomas H.; Leiserson, Charles Eric; Rivest, Ronald L. (The MIT electrical engineering and computer science series, 1990)