Exercise

Finding the minimum node of a BST

In this exercise, you will practice on a BST to find the minimum node.

To test your code, you can use the following tree:

Graphical representation of a binary search tree.

It has been preloaded in the bst variable (line 14):

bst = CreateTree()

You can print the result that returns the find_min() method with this code (line 15):

print(bst.find_min())

Instructions

100 XP
  • Set current_node as the root.
  • Iterate over the nodes on the appropriate subtree.
  • Update the value for current_node.