public void DeleteWithValue(int input) { if (next != null) { if (next.data == input) { next = next.next; this.DeleteWithValue(input); } else { next.DeleteWithValue(input); } } }
public void DeleteWithValue(int input) { if (HeadNode == null) { return; } if (input == HeadNode.data) { HeadNode = HeadNode.next; } else { HeadNode.DeleteWithValue(input); } }