BST Operation: Insert (How it works)

  • Explain and trace the core operations of a Binary Search Tree.

In a BST implementation of OrderedSet ADT, the' insert' operation must (partially) traverse the tree to find where to insert the new element, so the BST remains valid.

Exercise Insert $6$ to the following BST.

Solution