Algorithms, Part I & II, Robert Sedgewick and Kevin Wayne, Princeton University