Exemplo n.º 1
0
        private static void Method3()
        {
            MaxStack stack = new MaxStack();

            stack.Push(74);
            stack.PopMax();
            stack.Push(89);
            stack.Push(67);
            stack.PopMax();
            stack.Pop();
            stack.Push(61);
            stack.Push(-77);
            stack.PeekMax();
            stack.PopMax();
        }
Exemplo n.º 2
0
        private static void Method5()
        {
            MaxStack stack = new MaxStack();

            stack.Push(5);
            stack.Push(1);
            stack.PopMax();
            stack.PeekMax();
        }
Exemplo n.º 3
0
        private static void Method1()
        {
            MaxStack stack = new MaxStack();

            stack.Push(5);
            stack.Push(1);
            stack.Push(5);
            stack.Top();     //-> 5
            stack.PopMax();  //-> 5
            stack.Top();     //-> 1
            stack.PeekMax(); //-> 5
            stack.Pop();     //-> 1
            stack.Top();     //-> 5
        }