Write a program binary_search_tree.py
that implements a BinarySearchTree
class, which consists of a binary search tree made up of TreeNode
objects as described in the text.
Once you've created the file with those two classes defined, create a main
program that:
puts the following keys into the tree in this order (each key can have a value of None
):
5
3
1
9
12
13
15
get(5)
on the treeget(10)
on the treeexecute the following for loop on your tree:
for item in bst:
print(item)
What does the binary tree actually look like? Draw a picture of the tree, beginning at its root 5.