Guest User

Untitled

a guest
Jan 16th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. Node* BinarySearchTree::search(Node *root, int key) {
  2. if (!root || root->val == key) {
  3. return root;
  4. }
  5.  
  6. if (root->val < key) {
  7. return search(root->right, key);
  8. }
  9. return search(root->left, key);
  10. }
Add Comment
Please, Sign In to add comment