Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class node
- {
- public:
- int data;
- node *left;
- node *right;
- };
- class btree
- {
- public:
- btree(node *vlozenyroot = NULL)
- {
- root=vlozenyroot;
- }
- node *get_root()
- {
- return root;
- }
- int get_node_value(root)
- {
- return root->data;
- }
- void insert(int data)
- {
- node *temp;
- int cmp;
- if(root == NULL)
- {
- root = new node(new_value);
- }
- else
- {
- temp = root;
- while(1)
- {
- cmp = get_node_value(root);
- if(data < cmp )
- private:
- node *root;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement