- Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathAVLTreeNode.cs
45 lines (40 loc) · 1.26 KB
/
AVLTreeNode.cs
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
namespaceDataStructures.Trees
{
/// <summary>
/// AVL Tree Node.
/// </summary>
publicclassAVLTreeNode<T>:BSTNode<T>whereT:System.IComparable<T>
{
privateint_height=0;
publicAVLTreeNode():this(default(T),0,null,null,null){}
publicAVLTreeNode(Tvalue):this(value,0,null,null,null){}
publicAVLTreeNode(Tvalue,intheight,AVLTreeNode<T>parent,AVLTreeNode<T>left,AVLTreeNode<T>right)
{
base.Value=value;
Height=height;
Parent=parent;
LeftChild=left;
RightChild=right;
}
publicvirtualintHeight
{
get{returnthis._height;}
set{this._height=value;}
}
publicnewAVLTreeNode<T>Parent
{
get{return(AVLTreeNode<T>)base.Parent;}
set{base.Parent=value;}
}
publicnewAVLTreeNode<T>LeftChild
{
get{return(AVLTreeNode<T>)base.LeftChild;}
set{base.LeftChild=value;}
}
publicnewAVLTreeNode<T>RightChild
{
get{return(AVLTreeNode<T>)base.RightChild;}
set{base.RightChild=value;}
}
}
}