Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            StackWithMin stack = new StackWithMin();
            stack.push(5);
            stack.push(6);
            stack.push(3);
            stack.push(7);
            Console.WriteLine(stack.Min());
            stack.pop();
            stack.pop();
            Console.WriteLine(stack.Min());

            StackWithMin2 stack2 = new StackWithMin2();
            stack2.push(5);
            stack2.push(6);
            stack2.push(3);
            stack2.push(7);
            Console.WriteLine(stack2.Min());
            stack2.pop();
            stack2.pop();
            Console.WriteLine(stack2.Min());
        }
Ejemplo n.º 2
0
        public static TheoryData <StackWithMin> getStack()
        {
            int[] values = { 4, 2, 3, 1, 1, 5, 1, 3 };

            StackWithMin min = new StackWithMin();

            foreach (int el in values)
            {
                min.push(el);
            }

            return(new TheoryData <StackWithMin>()
            {
                min
            });
        }
Ejemplo n.º 3
0
        //public static void Main(string[] args)
        //{
        //    CTCIVersion();
        //}

        public static void CTCIVersion()
        {
            var minStack = new StackWithMin();

            minStack.push(10);
            minStack.push(6);
            minStack.push(4);
            minStack.push(8);
            minStack.push(3);
            minStack.push(8);

            Console.WriteLine(minStack.min());
            Console.ReadLine();
        }