Excercise 1.11 — linearization of tree recursion.