SHARE
TWEET

Untitled

a guest Feb 18th, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Node* Add(Node*&root,int k)
  2. {
  3.     if(root==nullptr)
  4.     {
  5.         Node* temp = new Node;
  6.         temp->key=k;
  7.         temp->left=nullptr;
  8.         temp->right=nullptr;
  9.         temp->parent=root;
  10.         root=temp;
  11.         return root;
  12.     }
  13.     else if(k>= root->key)return Add(root->right,k);
  14.     return Add(root->left,k);
  15.  
  16. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top