Задача 12A. Class MStack

Входной файл:Стандартный вход   Ограничение времени:1 сек
Выходной файл:Стандартный выход   Ограничение памяти:512 Мб
Максимальный балл:1  

Условие

Требуется написать на языке C# класс MStack реализующий интерфейс IStack.

                
    public interface IStack<T> : IEnumerable, IEnumerable<T>
    {
        // Сводка:
        //     Gets the number of elements contained in the IStack.
        //
        // Возврат:
        //     The number of elements contained in the IStack.
        public int Count { get; }
        //
        // Сводка:
        //     Removes all objects from the IStack.
        public void Clear();
        //
        // Сводка:
        //     Determines whether an element is in the IStack.
        //
        // Параметры:
        //   item:
        //     The object to locate in the IStack. The value can
        //     be null for reference types.
        //
        // Возврат:
        //     true if item is found in the IStack; otherwise, false.
        public bool Contains(T item);
        //
        // Сводка:
        //     Returns the object at the top of the IStack without
        //     removing it.
        //
        // Возврат:
        //     The object at the top of the IStack.
        //
        // Исключения:
        //   T:System.InvalidOperationException:
        //     The IStack is empty.
        public T Peek();
        //
        // Сводка:
        //     Removes and returns the object at the top of the IStack.
        //
        // Возврат:
        //     The object removed from the top of the IStack.
        //
        // Исключения:
        //   T:System.InvalidOperationException:
        //     The IStack is empty.
        public T Pop();
        //
        // Сводка:
        //     Inserts an object at the top of the IStack.
        //
        // Параметры:
        //   item:
        //     The object to push onto the IStack. The value can
        //     be null for reference types.
        public void Push(T item);
        //
        // Сводка:
        //     Copies the IStack to a new array.
        //
        // Возврат:
        //     A new array containing copies of the elements of the IStack.
        public T[] ToArray();
    }
                
            

IStack заливать не нужно. MStack должен находиться в namespace MyCollection. Запрещено использовать готовые реализации Stack или любые другие коллекции из System.Collection.Generic.


0.045s 0.014s 15