Пример #1
0
Файл: Run.cs Проект: dhei/Algo
        static void Main(string[] args)
        {
            StackImplByQueue.Test();

            //MinHeap.Test();

            //MinPQ.Test();

            //MaxPQ.Test();

            //KthSmallestElement.Test();
        }
Пример #2
0
        //[Test]
        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());
                }
            }
        }
Пример #3
0
 //[Test]
 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());
     }
 }