예제 #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());
                }
            }
        }
예제 #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());
     }
 }