Tree traversal: Difference between revisions

Content deleted Content added
Arbitrary trees: optional → optimal
Tag: Reverted
Undid revision 1135319353 by Rory O'Kane (talk): no, "optional" (i.e. "can be omitted") was right
Line 83:
# Visit the current node for post-order traversal.
 
Depending on the problem at hand, pre-order, post-order, and especially one of the number of subtrees − 1 in-order operations may be optimaloptional. Also, in practice more than one of pre-order, post-order, and in-order operations may be required. For example, when inserting into a ternary tree, a pre-order operation is performed by comparing items. A post-order operation may be needed afterwards to re-balance the tree.
 
===Breadth-first search===