Tree traversal: Difference between revisions

Content deleted Content added
Einabla (talk | contribs)
m Fix grammar in description of pre-order traversal
Arbitrary trees: optional → optimal
Tag: Reverted
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 optionaloptimal. 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===