示例#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;
 }