Algorithm SearchBST(val root <pointer>,
Val argument <key>)
Search a binary search tree for a given value
Pre : root is the root to a binary tree
Return the node address if the value is found or null if the node is not in the tree
1 if (root is null)
1 return null
2 end if
3 if (argument < root->key)
1 return searchBST(root->left, argument)
4 elseif (argument > root->key)
1 return searchBST(root->right, argument)
5 else
1 return root
6 end if
end searchBST