// Behaviors public void Push(Type newObj) { LinkedStackNode <Type> newTop = new LinkedStackNode <Type>(newObj); newTop.SetNextNode(top); top = newTop; }
public Type Pop() { LinkedStackNode <Type> savedTop = top; top = savedTop.GetNextNode(); savedTop.SetNextNode(null); return(savedTop.GetHeldObj()); }