Example #1
0
        public int Pop()
        {
            NodeWithMin temp = last;

            last = last.Next;
            return(temp.Data);
        }
Example #2
0
        public void Push(int item)
        {
            int minvalue = GetMin();

            if (item < minvalue)
            {
                minvalue = item;
            }
            NodeWithMin newitem = new NodeWithMin(item, minvalue);

            newitem.Next = last;
            last         = newitem;
        }