示例#1
0
 public void DeleteWithValue(int input)
 {
     if (next != null)
     {
         if (next.data == input)
         {
             next = next.next;
             this.DeleteWithValue(input);
         }
         else
         {
             next.DeleteWithValue(input);
         }
     }
 }
示例#2
0
 public void DeleteWithValue(int input)
 {
     if (HeadNode == null)
     {
         return;
     }
     if (input == HeadNode.data)
     {
         HeadNode = HeadNode.next;
     }
     else
     {
         HeadNode.DeleteWithValue(input);
     }
 }