﻿//Problem 5. Generic class

//Write a generic class GenericList<T> that keeps a list of elements of some parametric type T.
//Keep the elements of the list in an array with fixed capacity which is given as parameter in the class constructor.
//Implement methods for adding element, accessing element by index, removing element by index, inserting element at given position, 
//clearing the list, finding element by its value and ToString().
//Check all input parameters to avoid accessing elements at invalid positions.

namespace _02.GenericClass
{
    using System;
    using System.Linq;
    using Models;

    public class Test
    {
        static void Main()
        {
            var list = new GenericList<int>(3);
            list.Add(5);
            list.Add(2);
            list.Add(3);

            list.RemoveByIndex(1);
            list.Insert(1, 123);

            Console.WriteLine(list[1]);
            Console.WriteLine(list);
            Console.WriteLine(list.Min());
            Console.WriteLine(list.Max());

        }
    }
}
