Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
 public void Clear()
 {
     First = Last = null;
     Count = 0;
 }
Пример #4
0
        public void RemoveLast()
        {
            if (!RemoveChecker())
                return;
            Last = Last.Previous;
            Last.Next = null;

            --Count;
        }