public void push(int data) { StackIntNode oldLast = last; last = new StackIntNode(data); last.Next = oldLast; }
public int pop() { int value = last.Data; if (last.Next != null) { last = last.Next; } return(value); }
public void print() { string line = ""; curr = last; while (curr.Next != null) { line += curr + " "; curr = curr.Next; } line += curr + " "; Console.WriteLine(line); }
public StackIntLinkedList(int data) { last = new StackIntNode(data); }