another nodeand thus contributes one unit to the above sum by proposition the running time of algorithm height when called on the root of tis ( )where is the number of nodes of preorder traversal traversal of tree is systematic way of accessingor "visiting,all the nodes of in this sectionwe present basic traversal scheme for treescalled preorder traversal in the next sectionwe will study another basic traversal schemecalled postorder traversal in preorder traversal of tree tthe root of is visited first and then the subtrees rooted at its children are traversed recursively if the tree is orderedthen the subtrees are traversed according to the order of the children the specific action associated with the "visitof node depends on the application of this traversaland could involve anything from incrementing counter to performing some complex computation for the pseudo-code for the preorder traversal of the subtree rooted at node is shown in code fragment we initially call this algorithm with preorder( , root()code fragment algorithm preorder for performing the preorder traversal of the subtree of tree rooted at node the preorder traversal algorithm is useful for producing linear ordering of the nodes of tree where parents must always come before their children in the ordering such orderings have several different applications we explore simple instance of such an application in the next example figure preorder traversal of an ordered treewhere the children of each node are ordered from left to right