Introduction to algorithms [electronic resource] - Cormen, Thomas H. (MIT Press, 2001)