Node* search(Node* root, int key) {
if(root == NULL || root->data == key)
return root;
// Key is greater than root's data
if(root->data < key)
return search(root->right,key);
// Key is smaller than root's data
return search(root->left,key);
}
C++Copy