Пример #1
0
        public void push(int item)
        {
            NodeN t = new NodeN(item);

            t.next = top;
            top    = t;
        }
Пример #2
0
 public int pop()
 {
     if (top != null)
     {
         int item = top.data;
         top = top.next;
         return(item);
     }
     return(0);
 }
Пример #3
0
        void appendToTail(int d)
        {
            NodeN end = new NodeN(d);
            NodeN n   = this;

            while (n.next != null)
            {
                n = n.next;
            }
            n.next = end;
        }