forked from TheAlgorithms/C-Sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAATreeNode.cs
40 lines (36 loc) · 1.22 KB
/
AATreeNode.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
namespace DataStructures.AATree
{
/// <summary>
/// Generic node class for AATree.
/// </summary>
/// <typeparam name="TKey">Type of key for node.</typeparam>
public class AaTreeNode<TKey>
{
/// <summary>
/// Initializes a new instance of the <see cref="AaTreeNode{TKey}" /> class.
/// </summary>
/// <param name="key">The initial key of this node.</param>
/// <param name="level">The level of this node. See <see cref="AaTree{TKey}" /> for more details.</param>
public AaTreeNode(TKey key, int level)
{
Key = key;
Level = level;
}
/// <summary>
/// Gets or Sets key for this node.
/// </summary>
public TKey Key { get; set; }
/// <summary>
/// Gets or Sets level for this node.
/// </summary>
public int Level { get; set; }
/// <summary>
/// Gets or sets the left subtree of this node.
/// </summary>
public AaTreeNode<TKey>? Left { get; set; }
/// <summary>
/// Gets or sets the right subtree of this node.
/// </summary>
public AaTreeNode<TKey>? Right { get; set; }
}
}