algorithm findnode(rootvalue prevalue is the value of the node we want to find the parent of root is the root node of the bst posta reference to the node of value if foundotherwise if root return end if if root value value return root else if value root value return findnode(root leftvalue else return findnode(root rightvalue end if end findnode astute readers will have noticed that the findnode algorithm is exactly the same as the contains algorithm (defined in ss with the modification that we are returning reference to node not true or alse given findnodethe easiest way of implementing contains is to call findnode and compare the return value with finding the smallest and largest values in the binary search tree to find the smallest value in bst you simply traverse the nodes in the left subtree of the bst always going left upon each encounter with nodeterminating when you find node with no left subtree the opposite is the case when finding the largest value in the bst both algorithms are incredibly simpleand are listed simply for completeness the base case in both indm inand indm ax algorithms is when the left ( indm in)or right ( indm axnode references are in which case we have reached the last node algorithm findmin(root preroot is the root node of the bst root postthe smallest value in the bst is located if root left return root value end if findmin(root left end findmin