5.双链表结点类
namespace DSList
{
public class DbNode<T>
{
/// <summary>
/// fields
/// </summary>
private DbNode<T> prev; //Previous reference domain
private T data; //Data domain
private DbNode<T> next; //Next reference domain
/// <summary>
/// properties
/// </summary>
public DbNode<T> Prev
{
get
{
return prev;
}
set
{
prev = value;
}
}
public T Data
{
get
{
return data;
}
set
{
data = value;
}
}
public DbNode<T> Next
{
get
{
return next;
}
set
{
next = value;
}
}
/// <summary>
/// constructors
/// </summary>
public DbNode()
{
this.prev = null;
this.data = default(T);
this.next = null;
}
public DbNode(T data)
{
this.data = data;
}
public DbNode(DbNode<T> next)
{
this.next = next;
}
public DbNode(T data, DbNode<T> next)
{
this.data = data;
this.next = next;
}
}
}