Introduction To The Analysis Of Algorithms by Robert Sedgewick & Philippe Flajolet