public T remove()
            {
                if (oldStack.isEmpty())
                {
                    shiftStacks();
                }

                try
                {
                    return(oldStack.pop());
                }
                catch (EmptyStackException ex)
                {
                    throw new EmptyQueueException($"{ex.TargetSite.DeclaringType.FullName} --> {nameof(remove)}");
                }
            }
Exemple #2
0
 public int min()
 {
     if (base.isEmpty())
     {
         throw new EmptyStackException();
     }
     return((stackForMin.isEmpty())
             ? int.MaxValue
             : stackForMin.peek());
 }