Beispiel #1
0
        public static void Test()
        {
            StackWithMin swm = new StackWithMin();

            swm.Push(2);
            swm.Push(1);
            swm.Push(3);
            swm.Push(4);
            int min = swm.Min();

            Console.Write("Stack: ");
            while (swm.Count() > 0)
            {
                Console.Write(swm.Pop() + " ");
            }
            Console.WriteLine("\nMin() = " + min);
        }
Beispiel #2
0
 public static void Test()
 {
     StackWithMin swm = new StackWithMin();
     swm.Push(2);
     swm.Push(1);
     swm.Push(3);
     swm.Push(4);
     int min = swm.Min();
     Console.Write("Stack: ");
     while (swm.Count() > 0)
     {
         Console.Write(swm.Pop() + " ");
     }
     Console.WriteLine("\nMin() = " + min);
 }