The iterative version (stack + pointer) is quite hard and unintuitive. Esp the post-order traversal which requires one more pointer.

Concept recap

Recursive traversal

  1. Identify the parameter(s) and return value (type) of the recursive function
  2. Identify the stop condition of the recursion
  3. Find the what need to be processed for each layer of recursion

Iterative traversal (version 1, plain)