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

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

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