예제 #1
0
        public int Pop()
        {
            int t = this.head.GetValue();

            this.head = this.head.GetNext();
            return(t);
        }
예제 #2
0
        public override string ToString()
        {
            string  ray  = "";
            NodeInt temp = this.head;

            while (temp != null)
            {
                ray += temp.ToString() + " ";
                temp = temp.GetNext();
            }
            return(ray);
        }
예제 #3
0
 public void SetNext(NodeInt next)
 {
     this.next = next;
 }
예제 #4
0
 public Stackint()
 {
     this.head = null;
 }
예제 #5
0
 public NodeInt(int v, NodeInt next)
 {
     this.value = v;
     this.next  = next;
 }
예제 #6
0
 public NodeInt(int v)
 {
     this.value = v;
     this.next  = null;
 }
예제 #7
0
        public void Push(int v)
        {
            NodeInt ni = new NodeInt(v, this.head);

            this.head = ni;
        }