Beispiel #1
0
        public T Pop()
        {
            var oldHead = Head;

            Head = Head.Next;
            // oldHead.Next = null;
            return(oldHead.Value);
        }
Beispiel #2
0
        public void Push(T item)
        {
            var newCell = new LinkedStackNode <T>(item)
            {
                Next = Head
            };

            Head = newCell;
        }
Beispiel #3
0
 public LinkedStack(LinkedStackNode <T> head)
 {
     Head = head;
 }