Binary search tree: Difference between revisions

Content deleted Content added
Overview: In the Overview section, refined a sentence to clarify the definition of BST (Binary Search Tree).
Traversal: Added a fact that Inorder traversal visits nodes with the order of non-decreasing node key sequences.
Line 200:
{{see also|Threaded binary tree}}
A BST can be [[Tree traversal|traversed]] through three basic algorithms: [[inorder traversal|inorder]], [[pre-order traversal|preorder]], and [[post-order traversal|postorder]] tree walks.<ref name="algo_cormen" />{{rp|287}}
*'''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.