Algorithms In C++ Parts 1-4 by Robert Sedgewick.