search trees with the relationship between the keys if the root node contains keys in its left subtreethen it cannot possibly contain the minimum key value since all of the keys to the left of the root are smaller than the root what if the root node does not have left childin this casethe root would contain the smallest key value since all of the keys to the right are larger than the root if we applied the same logic to the left child of the root node (assuming it has left childand then to that node' left child and so onwe will eventually find the minimum key value that value will be found in node that is either leaf or an interior node with no left child it can be located by starting at the root and following the left child links until null link is encounteredas illustrated in figure the maximum key value can be found in similar fashion traverse left as far as possible minimum key figure finding the minimum or maximum key in binary search tree listing provides recursive helper method for finding the node that contains the minimum key value in the binary search tree the method requires the root of the tree or of subtree as an argument it returns either reference to the node containing the smallest key value or none when the tree is empty listing find the element with the minimum key value in binary search tree class bstmap helper method for finding the node containing the minimum key def _bstminumumselfsubtree )if subtree is none return none elif subtree left is none return subtree else return self _bstminimumsubtree left