public DoublyLinkedListNode InsertAtFront(DoublyLinkedListNode doublyLinkedListNode, int data) { if (size == capacity) { Console.WriteLine("Doubly Linked List is full! Cannot insert!"); return(doublyLinkedListNode); } size++; if (doublyLinkedListNode == null) { doublyLinkedListNode = new DoublyLinkedListNode(data); return(doublyLinkedListNode); } DoublyLinkedListNode doublyLinkedListNodeNew = new DoublyLinkedListNode(data); doublyLinkedListNodeNew.SetDoublyLinkedListNodeNext(doublyLinkedListNode); doublyLinkedListNode.SetDoublyLinkedListNodePrevious(doublyLinkedListNodeNew); doublyLinkedListNode = doublyLinkedListNodeNew; return(doublyLinkedListNode); }
public void SetDoublyLinkedListNodeHead(DoublyLinkedListNode doublyLinkedListNode) { head = doublyLinkedListNode; }
public void SetDoublyLinkedListNodeNext(DoublyLinkedListNode doublyLinkedListNode) { nextNode = doublyLinkedListNode; }
public DoublyLinkedList(DoublyLinkedListNode doublyLinkedListNode, int capacity) { this.capacity = capacity; head = doublyLinkedListNode; }
public void SetDoublyLinkedListNodePrevious(DoublyLinkedListNode doublyLinkedListNode) { previousNode = doublyLinkedListNode; }