finding the parent of given node the purpose of this algorithm is simple to return reference (or pointerto the parent node of the one with the given value we have found that such an algorithm is very usefulespecially when performing extensive tree transformations algorithm findparent(valueroot prevalue is the value of the node we want to find the parent of root is the root node of the bst and is posta reference to the parent node of value if foundotherwise if value root value return end if if value root value if root left return else if root left value value return root else return findparent(valueroot left end if else if root right return else if root right value value return root else return findparent(valueroot right end if end if end findparent special case in the above algorithm is when the specified value does not exist in the bstin which case we return callers to this algorithm must take account of this possibility unless they are already certain that node with the specified value exists attaining reference to node this algorithm is very similar to ss but instead of returning reference to the parent of the node with the specified valueit returns reference to the node itself againis returned if the value isn' found