Solutions for problems in  http://cslibrary.stanford.edu/110/BinaryTrees.html