Пример #1
0
        public Type Pop()//出栈
        {
            Type dt = top.Data;

            top = top.Next;
            return(dt);
        }
Пример #2
0
        public string GetStackALLDate(string sname)
        {
            string str = "  】";

            if (IsEmpty())
            {
                str = sname + " stack is null";
            }
            CStacknode <Type> p = top;

            while (p != null)
            {
                str = p.Data + "    " + str;
                p   = p.Next;
            }
            str = "【  " + str + "\r\n";
            str = str + "---------------------------------------" + "\r\n";
            return(str);
        }
Пример #3
0
 public bool Push(Type item)//入栈
 {
     top = new CStacknode <Type>(item, top);
     return(true);
 }
Пример #4
0
        }                                     //判栈满

        public CLinkStack()
        {
            top = null;
        }
Пример #5
0
 //--------------------------------------------------------------------------------
 public void MakeEmpty()
 {
     top = null;
 }                                      //清空
Пример #6
0
 public CStacknode(Type data, CStacknode <Type> next)
 {
     this.data = data;
     this.next = next;
 }
Пример #7
0
 public CStacknode(Type data)
 {
     this.data = data;
     next      = null;
 }
Пример #8
0
 //--------------------------------------------------------------------------------
 public CStacknode()
 {
     next = null;
 }