we compare with and since is less than we move level below node and to its left but there is no node there thereforewe create node with the value and associate it with the left pointer of node to obtain the following structureso farwe have been dealing only with nodes that contain only integers or numbers for numbersthe idea of greater than and lesser than are clearly defined strings would be compared alphabeticallyso there are no major problems there either but if you want to store your own custom data types inside bstyou would have to make sure that your class supports ordering let' now create function that enables us to add data as nodes to the bst we begin with function declarationdef insert(selfdata)by nowyou will be used to the fact that we encapsulate the data in node this waywe hide away the node class from the client codewho only needs to deal with the treenode node(dataa first check will be to find out whether we have root node if we don'tthe new node becomes the root node (we cannot have tree without root node)if self root_node is noneself root_node node else