Exemple #1
0
 public void remove(int data)
 {
     if (next != null)
     {
         if (next.data == data)
         {
             next.next.prev = this;
             this.next      = next.next;
             return;
         }
         next.remove(data);
     }
 }
Exemple #2
0
 public void remove(int data)
 {
     if (headNode == null)
     {
         Console.WriteLine("Empty List");
         return;
     }
     else if (headNode.data == data)
     {
         headNode.next.prev = null;
     }
     else if (tailNode.data == data)
     {
         tailNode.prev.next = null;
     }
     else
     {
         headNode.remove(data);
     }
 }