Пример #1
0
 public object Pop()
 {
     StackElement element = _head;
     _head = _head.NextElement;
     element.NextElement = null;
     return element.Data;
 }
Пример #2
0
        public void Push(object value)
        {
            StackElement element = new StackElement();
            element.Data = value;

            element.NextElement = _head;
            _head = element;
        }