List: A list is a set of arbitrary storage units to store data elements in a linear table. To do this, when storing data elements, in addition to storing information about the data element itself, store the address information of the data element that is adjacent to it. These two pieces of information form the storage image of the data element, known as the node. A domain called a node that stores information about the element itself, the domain that stores the address information stored with its adjacent data element is called the reference domain of the node.
Node class:
using System;
using System.Collections.Generic;
using System.Text;
namespace DateStructrues.Lists.Node
{
///<summary>
///node class.
///</summary>
///<typeparam name= "T" ></typeparam>
public class dnode<t>
{
#region Fields
//
//Data domain
//
T _data;
//
//Address field (next)
//
dnode<t> _next;
//
//Address field (prev)
//
dnode<t> _prev;
#endregion
#region Constructor
///<summary>
///Builder
///</summary>
///<param name= "value" ></param>
public Dnode (T value)
{
_data = value;
}
///<summary>
///Builder
///</summary>
///<param name= "value" ></param>
///<param name= "prev" ></param>
///<param name= "Next" ></param>
public Dnode (T value, dnode<t> prev, dnode<t> next)
{
_data = value;
_prev = prev;
_next = next;
}
///<summary>
///Builder
///</summary>
Public Dnode () {}
#endregion
#region Properties
///<summary>
///Address Field properties (previous).
///</summary>
Public dnode<t> Prev
{
Get
{
return _prev;
}
Set
{
_prev = value;
}
}
///<summary>
///Address Field properties (next).
///</summary>
Public dnode<t> Next
{
Get
{
return _next;
}
Set
{
_next = value;
}
}
///<summary>
///data Field properties.
///</summary>
Public T Data
{
Get
{
return _data;
}
Set
{
_data = value;
}
}
#endregion
}
}