//This implementation allows the stacks to have different sizes.
        //The size of each stack expands when the stack is full and there is extra space in the array.
        //Shrinking of stack size is not yet implemented.
        static void NotMain(String[] args)
        {
            MultipleStack s = new MultipleStack(3, 20);
            s.Push(10, 1);
            s.Push(111, 0);
            s.Push(11, 1);
            s.Push(1, 2);
            s.Push(2, 2);
            s.Push(12, 1);
            s.Push(13, 1);
            s.Push(3, 2);
            s.Push(14, 1);
            s.Push(15, 1);
            s.Push(16, 1);
            s.Push(17, 1);
            s.Push(18, 1);
            s.Push(4, 2);
            s.Pop(2);
            s.Push(19, 1);
            Console.WriteLine(s);

            Console.Read();
        }
Пример #2
0
        //This implementation allows the stacks to have different sizes.
        //The size of each stack expands when the stack is full and there is extra space in the array.
        //Shrinking of stack size is not yet implemented.
        static void NotMain(String[] args)
        {
            MultipleStack s = new MultipleStack(3, 20);

            s.Push(10, 1);
            s.Push(111, 0);
            s.Push(11, 1);
            s.Push(1, 2);
            s.Push(2, 2);
            s.Push(12, 1);
            s.Push(13, 1);
            s.Push(3, 2);
            s.Push(14, 1);
            s.Push(15, 1);
            s.Push(16, 1);
            s.Push(17, 1);
            s.Push(18, 1);
            s.Push(4, 2);
            s.Pop(2);
            s.Push(19, 1);
            Console.WriteLine(s);

            Console.Read();
        }