figure simple binary search tree the tree filledso the next key is going to be the left or right child of either or since is greater than and it becomes the right child of similarly is less than and so it becomes the left child of is also less than so it must be in the left subtree of howeverit is greater than so it becomes the right child of to implement the binary search treewe will use the nodes and references approach similar to the one we used to implement the linked listand the expression tree howeverbecause we must be able create and work with binary search tree that is emptyour implementation will use two classes the first class we will call binarysearchtreeand the second class we will call treenode the binarysearchtree class has reference to the treenode that is the root of the binary search tree in most cases the external methods defined in the outer class simply check to see if the tree is empty if there are nodes in the treethe request is just passed on to private method defined in the binarysearchtree class that takes the root as parameter in the case where the tree is empty or we want to delete the key at the root of the treewe must take special action the code for the binarysearchtree class constructor along with few other miscellaneous functions is shown below basic binarysearchtree class incomplete class binarysearchtreedef __init__(self)self root none self size def length(self)return self size def __len__(self)return self size def __iter__(self)return self root __iter__(the treenode class provides many helper functions that make the work done in the binarysearchtree class methods much easier the constructor for treenodealong trees and tree algorithms