public T Pop() { var oldHead = Head; Head = Head.Next; // oldHead.Next = null; return(oldHead.Value); }
public void Push(T item) { var newCell = new LinkedStackNode <T>(item) { Next = Head }; Head = newCell; }
public LinkedStack(LinkedStackNode <T> head) { Head = head; }