Ejemplo n.º 1
0
        public T pop()
        {
            if (_size == 0)
            {
                throw new InsufficientExecutionStackException("Stack empty");
            }
            var data = _top.getData();

            _top = _top.getNext();
            _size--;
            return(data);
        }
Ejemplo n.º 2
0
        public IEnumerator GetEnumerator()
        {
            StackElementLinkedList <T> current = _top;

            while (current != null)
            {
                yield return(current.getData());

                current = current.getNext();
            }
        }