Introduction to algorithms - Cormen, Thomas H.; Leiserson, Charles E.; Rivest, Ronald L.; Stein, Clifford (McGraw-Hill, 2001)