INTRODUCTION TO ALGORITHMS - CORMEN, T.H.; LEISERSON, C.E. (PRENTICE HALL, 2007)