On 12/03/2011 09:31, spir wrote:
<snip>
You are right about depth / breadth.
(But I also have always found preorder/postorder misleading, or rather
inversed. For me,
the second one should be called postorder, since it postpones app on A after
app on A's
subnodes.
I agree. Basically:
- Preorder means the processing of each node on entry to its subtree (before visiting the
children)
- Postorder means the processing of each node on exit from its subtree (after visiting the
children)
A better, non-misleading, naming may be branch-first (case 1 above) vs
children-first (case 2).)
"Branch-first" to me is equally misleading. How about trunk-first and
leaves-first?
Stewart.