コード例 #1
0
 public void insertAtFront(string newData)
 {
     BackLinkedNode newNode = null;
     if (!String.Equals(newData, "dUmMy"))
     {
         //If the new data is not the same as the data contained in the dummy node, create a new Node and insert it into the front of the LinkedList
         newNode = new BackLinkedNode(newData);
         newNode.setNext(dummyNode.getNext());
         dummyNode.getNext().setPrev(newNode);
         newNode.setPrev(dummyNode);
         dummyNode.setNext(newNode);
         size++;
     }
 }