public void Add(T item) { var listEntry = new ListEntry <T>(_region, item); listEntry.Extend(_head); _head = listEntry; _count++; }
public void RemoveAt(int index) { if (index > this.Count) { throw new InvalidOperationException("Insufficient elements"); } ListEntry <T> current = _head; ListEntry <T> previous = null; for (int count = 0; count < index; count++) { previous = current; current = current.Tail; } previous.Extend(current.Tail); _count--; }