public void AddFirst(int value) { if (First != null) { First = new Node(value, null, First); First.Next.Previous = First; } else Last = First = new Node(value, null, null); ++Count; }
public void AddLast(int value) { if (First != null) { Last = new Node(value, Last, null); Last.Previous.Next = Last; } else Last = First = new Node(value, null, null); ++Count; }
public void Clear() { First = Last = null; Count = 0; }
public void RemoveLast() { if (!RemoveChecker()) return; Last = Last.Previous; Last.Next = null; --Count; }