private void PrintL(DListNode Node) { while (Node != null) { Console.Write("{0} ", Node.n); Node = Node.next; } Console.WriteLine(); }
public DListNode Insert(int n) { if (head == null && tail == null) { head = new DListNode(n); tail = head; return(head); } else { DListNode temp = new DListNode(n); tail.next = temp; temp.prev = tail; tail = tail.next; return(tail); } }
public DoubleLinkedList() { head = null; tail = null; }
public DListNode(int n) { this.n = n; prev = null; next = null; }