Guest User

Untitled

a guest
Jan 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. struct node{
  2. int val;
  3. node* left;
  4. node* right;
  5. };
  6. //Initialize:
  7. node* root = new node;
  8. root->val = 7;
  9. root->left = NULL;
  10. root->right = NULL;
  11.  
  12. int* n = new(6);
  13.  
  14. struct node{
  15. int val;
  16. node* left;
  17. node* right;
  18. node(int);
  19. };
  20.  
  21. node::node(int _v){
  22. this->val = _v;
  23. this->left = this->right = nullptr;
  24. }
  25.  
  26. node *root = new node(6); // Works as you want
Add Comment
Please, Sign In to add comment