public void RemoveAt(int index) { Node aux = this.head; if (index == 0) { this.head = this.head.Next; if (head == null) { this.last = null; } this.count--; return; } for (int i = 0; i < index - 1; i++) { aux = aux.Next; } aux.Next = aux.Next.Next; this.count--; }
public void Add(object o) { if (this.head == null) { this.head = new Node(o); this.last = this.head; } else { this.last.Next = new Node(o); this.last = this.last.Next; } this.count++; }
public LinkedList() { this.head = null; this.last = null; this.count = 0; }