Advertisement
Czopsky

Untitled

May 18th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4.  
  5. struct node
  6. {
  7.   int T;
  8.   node *LEFT;
  9.   node *RIGHT;
  10. };
  11.  
  12. void insert( node *&root, int k ){
  13.     if (root!= NULL){
  14.         insert (root, k);
  15.     }
  16.     else{
  17.         root = new node;
  18.         root -> T = k;
  19.         root->LEFT = NULL;
  20.         root->RIGHT = NULL;
  21.     }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement