algs4 java code