Exemplo n.º 1
0
        public T Pop()
        {
            if (linkList.Count == 0)
            {
                throw new InvalidOperationException("Stack is empty.");
            }

            return(linkList.RemoveFirst());
        }
Exemplo n.º 2
0
        public T Dequeue()
        {
            if (linkList.Count == 0)
            {
                throw new InvalidOperationException("Queue is empty.");
            }

            return(linkList.RemoveFirst());
        }