Пример #1
0
        public T Pop()
        {
            if (linkList.Count == 0)
            {
                throw new InvalidOperationException("Stack is empty.");
            }

            return(linkList.RemoveFirst());
        }
Пример #2
0
        public T Dequeue()
        {
            if (linkList.Count == 0)
            {
                throw new InvalidOperationException("Queue is empty.");
            }

            return(linkList.RemoveFirst());
        }