A method of traversing binary trees, in which the node is processed after its left child, but before its right child.
A method of traversing binary trees, in which the node is processed after its children.
Postorder is trickier because the stack has to store nodes to visit and nodes to process and they aren t always simply related like they are in the inorder case
Intuitive explanation of binary tree traversals without recursion
However the other posters are right java doesn t expose any of the tree mechanics so a preorder or postorder isn t possible at this view;you can at least do the inorder walk using the iterator and a for each loop
Java TreeMap sorting options?