链表的概念以及链表与数组的差异不做过多的叙述,相信大家都耳熟能详,这里以c#语言实现简单的双向链表,作为备用,记录下~
public class Node<T> { private Node<T> prev; private Node<T> next; private T val; public Node<T> Prev { get { return prev; } set { prev = value; } } public Node<T> Next { get { return next; } set { next = value; } } public T Data { get { return val; } set { val = value; } } public Node(T item) { val = item; } }