Introduction to algorithms - Cormen, Thomas H. (The MIT Press McGraw - Hill Book Company, 1991)