Robert Sedgewick Algorithms Exercise