Example #1
0
        public void Push(T data)
        {
            if (counter % threshold == 0)
            {
                stack.Push(new MyStack <T>(data));
            }
            else
            {
                stack.Peek().Push(data);
            }

            counter++;
        }
Example #2
0
        public T Peek()
        {
            //if (IsEmpty())
            //    return default;

            if (oldestFirst.IsEmpty())
            {
                SwapStacks();
            }

            return(oldestFirst.Peek());
        }
Example #3
0
 public int Min()
 {
     return(stackOfMins.Peek());
 }