Introduction to the analysis of algorithms - Sedgewick, Robert (1996)