An iterative process executes in constant space, it has state variables that entirely define the state of the computation n.b. For the recursive process, first write out the recursive and base cases, then write the procedure. When we talk about order of growth in terms of time , we are counting the number of operations as a function of the input size. When we talk about order of growth in terms of space , we are counting the number of delayed operations as a function of the input size.
Time is proportional to number of tree nodes.
Space is proportional to max depth of tree.