algs4; exercise 1.1.25 - prove it based on the source code