Example #1
0
 public void push(Node node)
 {
     node.next = top;
     top = node;
     count++;
 }
Example #2
0
        public Node pop()
        {
            if (top == null)
            {
                throw new ElementOutOfBoundsException();
            }

            else
            {
                Node temp = top;
                top = top.next;
                count--;
                return temp;
            }
        }