Binary search tree: Difference between revisions

Content deleted Content added
Traversal: Added a fact that Inorder traversal visits nodes with the order of non-decreasing node key sequences.
Traversal: Added a fact that postorder traversal can be used to delete a BST from the bottom.
Line 202:
*'''Inorder tree walk''': Nodes from the left subtree get visited first, followed by the root node and right subtree. In a BST, such a traversal visits all the nodes in the order of non-decreasing key sequence.
*'''Preorder tree walk''': The root node gets visited first, followed by left and right subtrees.
*'''Postorder tree walk''': Nodes from the left subtree get visited first, followed by the right subtree, and finally the root. This can be used to delete a BST from the bottom (i.e., deleting children nodes first).
 
Following is a recursive implementation of the tree walks.<ref name="algo_cormen" />{{rp|287–289}}