3.单链表结点类
namespace DSList
{
public class Node<T>
{
// fields
private T data; //Data domain
private Node<T> next; //Next reference domain
// properties
public T Data
{
get
{
return data;
}
set
{
data = value;
}
}
public Node<T> Next
{
get
{
return next;
}
set
{
next = value;
}
}
// constructors
public Node(T data, Node<T> next)
{
this.data = data;
this.next = next;
}
public Node(T data)
{
this.data = data;
next = null;
}
public Node(Node<T> next)
{
data = default(T);
this.next = next;
}
public Node()
{
data = default(T);
next = null;
}
}
}