-
Notifications
You must be signed in to change notification settings - Fork 0
/
BF_AVL_Node.h
48 lines (40 loc) · 964 Bytes
/
BF_AVL_Node.h
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
#include "BF_Bin.h"
class BF_AVL_Node {
friend class BF_AVL_Tree;
public:
BF_Bin mValue;
BF_AVL_Node* mLeft;
BF_AVL_Node* mRight;
int mHeight;
public:
BF_AVL_Node()
{
mLeft = nullptr;
mRight = nullptr;
mHeight = 0;
}
~BF_AVL_Node() = default;
// BF_AVL_Node(const BF_AVL_Node& other): mValue(other.mValue)
// {
// mLeft = other.mLeft;
// mRight = other.mRight;
// mHeight = other.mHeight;
// }
BF_AVL_Node(const BF_Bin& value): mValue(value)
{
mLeft = nullptr;
mRight = nullptr;
mHeight = 0;
}
BF_AVL_Node& operator=(const BF_AVL_Node& other) {
mValue = other.mValue;
mLeft = other.mLeft;
mRight = other.mRight;
mHeight = other.mHeight;
return *this;
}
void print() {
mValue.print();
std::cout << " " << mHeight << " ";
}
};