Пример #1
0
        static void Main(string[] args)
        {
            //GenericList<string> list = new GenericList<string>(5);
            //list.Add("232.3");
            //list.Add("will be removed");
            //list.Add("2dwad.3");
            //list.Add("2kj231332.3");
            //list.Add("2.3");
            //list.Add("over the initial size");
            //list.Add("over the initial size");
            //list.Add("over the initial size");


            GenericList <double> list = new GenericList <double>(5);

            list.Add(2.5);
            list.Add(5.5);
            list.Add(1023.5);
            list.Add(-23.5);
            list.Add(6.5);
            list.Add(28.5);
            list.Add(288.5);
            list.Add(10);
            list.Add(4);

            Console.WriteLine(list.Min());
            Console.WriteLine(list.Max());
        }
Пример #2
0
        // Print Length, Capacity and current GenericList
        private static void PrintLengthCapacity(GenericList <Point3D> points, string strIn = null)
        {
            if (strIn != null)
            {
                Console.WriteLine(strIn);
            }

            Console.WriteLine("Length = {0}", points.Length);
            Console.WriteLine("Capacity = {0}", points.Capacity);
            Console.WriteLine("List: {0}", points);
            Console.WriteLine();
            Console.WriteLine("Min element: {0}", points.Min());
            Console.WriteLine("Max element: {0}", points.Max());
            Console.WriteLine();
        }