Algorithms in Java. Sedgewick