日期:2014-05-17 浏览次数:20830 次
public class Node<T>
{
private T data;
public T Data
{
get { return data; }
set { data = value; }
}
private Node<T> lChild;//左孩子
public Node<T> LChild
{
get { return lChild; }
set { lChild = value; }
}
private Node<T> rChild;//右孩子
public Node<T> RChild
{
get { return rChild; }
set { rChild = value; }
}
public Node(T val, Node<T> lp, Node<T> rp)
{
data = val;
lChild = lp;
rChild = rp;
}
public Node(Node<T> lp, Node<T> rp)
{
lChild = lp;
rChild = rp;
data = default(T);
}
public Node(T val)
{
data = val;
lChild = null;
rChild = null;
}
public Node()
{
data = default(T);
lChild = null;
rChild = null;
}
&