static void Main(string[] args) { GenericList <int> list = new GenericList <int>(); Random rnd = new Random(); for (int i = 0; i < 10; i++) { int t = rnd.Next(1, 100); list.Add(t); } list.ForEach(t => Console.WriteLine(t)); int max = list.Head.Data; list.ForEach(t => max = t > max ? t : max); Console.WriteLine($"max:{max}"); int min = list.Head.Data; list.ForEach(t => min = t > min ? min : t); Console.WriteLine($"min:{min}"); }