Exemplo n.º 1
0
        public static void Test()
        {
            StackImplByQueue stack = new StackImplByQueue();

            for (int i = 0; i < 10; i++)
            {
                stack.Push(i);
                Console.WriteLine("Push({0})", i);
                if ((i & 1) == 0)
                {
                    Console.WriteLine("Pop() = " + stack.Pop());
                }
            }
        }
Exemplo n.º 2
0
 public static void Test()
 {
     StackImplByQueue stack = new StackImplByQueue();
     for (int i = 0; i < 10; i++)
     {
         stack.Push(i);
         Console.WriteLine("Push({0})", i);
         if ((i & 1) == 0)
             Console.WriteLine("Pop() = " + stack.Pop());
     }
 }