trees enter list of numbers from this example it appears that binary search tree can produce sorted list of values when traversed howlet' examine how this program behaves with this input initiallythe tree reference points to binarysearchtree object where the root pointer points to none as shown in fig into the tree in fig we insert the the insert method is called which immediately calls the __insert function on the root of the tree the __insert function is given treewhich in this case is none ( an empty treeand the __insert function returns new tree with the value inserted the root instance variable is set equal to this new tree as shown in fig which is the consequence of line of the code in sect in the following figures the dashed line indicates the new reference that is assigned to point to the new node each time the __insert function is called new tree is returned and the root instance variable is re-assigned on line most of the time it is re-assigned to point to the same node nowthe next value to be inserted is the inserting the calls __insert on the root node containing when this is doneit recursively calls __insert on the right subtreewhich is none (and not picturedthe result is new right subtree is created and the right subtree link of the node containing is made to point to it as shown in fig which is the consequence of line in sect again the dashed arrows indicate the new references that are assigned during the insert it doesn' hurt anything to reassign the references and the code works very nicely in the recursive __insert we always reassign the reference on lines and after inserting new value into the tree likewiseafter inserting new valuethe root reference is reassigned to the new tree after inserting the new value on line of the code in sect fig an empty binarysearchtree object this copy belongs to 'acha