Solve p54-p57 (binary trees)