-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinary_tree_node.h
More file actions
48 lines (45 loc) · 938 Bytes
/
binary_tree_node.h
File metadata and controls
48 lines (45 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef BINARY_TREE_NODE_H
#define BINARY_TREE_NODE_H
#include <stdio.h>
#include <iostream>
#include "teacher.h"
#include "student.h"
#include "person.h"
class binary_tree_node
{
friend class binary_tree;
public:
binary_tree_node(person *node)
{
this->data = node;
this->left = NULL;
this->right = NULL;
this->height = NULL;
}
/*~binary_tree_node()
{
if (this->data != NULL)
{
free(this->data);
free(this->left);
free(this->right);
}
}*/
void initialize()
{
this->data->initialize();
this->left = NULL;
this->right = NULL;
}
void display_binary_tree_node()
{
printf("Single list binary_tree_node \n");
this->data->display();
}
private:
person *data;
binary_tree_node *left;
binary_tree_node *right;
binary_tree_node *height;
};
#endif