Binary search tree, infix for computer systems

admin

Administrator
Staff member
; infix Infix prints the values in a binary search tree <br />;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br />; ;<br />; infix Infix prints the values in a binary search tree ;<br />; in infix order. ;<br />; ;<br />; ;<br />; Entry 0(r14)= ->Pointer to the root of a binary tree ;<br />; jal infix ;<br />; ;<br />; Uses r1 ;<br />; ;<br />;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br /><br /><br />infix<br />jrr31<br /><br /><br /><br /><br />Hi, i am taking computer system..below is the pesudo code, but i got lost converting it to another programming language.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><br />void infix(bst tree)                   // add n to the tree<br />{<br />    if ( tree != 0 )               // do nothing if the tree is empty<br />    {<br />        infix(tree.left);    // traverse the left children<br />        print tree.value;     // print the value in this node<br />        infix(tree.right);   // traverse the right children<br />    }<br />}<!--c2--></div><!--ec2-->
</div>
 
Back
Top