namespace DSList
{
public class TreeNode<T>
{
private T data;
private TreeNode<T> lChild;
private TreeNode<T> rChild;
public T Data
{
get
{
return data;
}
set
{
data = value;
}
}
public TreeNode<T> LChild
{
get
{
return lChild;
}
set
{
lChild = value;
}
}
public TreeNode<T> RChild
{
get
{
return rChild;
}
set
{
rChild = value;
}
}
public TreeNode(T val, TreeNode<T> lc, TreeNode<T> rc)
{
data = val;
lChild = lc;
rChild = rc;
}
public TreeNode(TreeNode<T> lc, TreeNode<T> rc)
{
data = default(T);
lChild = lc;
rChild = rc;
}
public TreeNode(T val)
{
data = val;
lChild = null;
rChild = null;
}
public TreeNode()
{
data = default(T);
lChild = null;
rChild = null;
}
}
}