public static void Main() { GenericList<int> listTesting = new GenericList<int>(1); listTesting.AddElement(2); listTesting.AddElement(3); listTesting.AddElement(4); listTesting.AddElement(5); listTesting.AddElement(6); listTesting.AddElement(-1000); Console.WriteLine(listTesting); listTesting.RemoveElemAtIndex(4); Console.WriteLine(listTesting); listTesting.InsertElemAtIndex(0, 123); Console.WriteLine(listTesting); Console.WriteLine(listTesting.FindElemByValue(123)); Console.WriteLine(listTesting.Max()); Console.WriteLine(listTesting.Min()); listTesting.ClearList(); Console.WriteLine(listTesting); }
static void Main(string[] args) { GenericList<int> test = new GenericList<int>(); Random randomNumber = new Random(); for (int i = 0; i < 10; i++) { test.AddElement(randomNumber.Next(1, 100)); } Console.WriteLine("The GenericList is:\n {0}",test); test.RemoveElementByIndex(0); Console.WriteLine("After removing element by index, the GenericList is:\n {0}",test); test.InsertElementByIndex(5, 89); Console.WriteLine("After insert new element, the GenericList is:\n {0}", test); test.FindElemByValue(89); Console.WriteLine("The maximal element is: {0}",test.Maximum()); Console.WriteLine("The minimal element is: {0}", test.Minimum()); test.CleanList(); Console.WriteLine("After clearing the GenericList is: {0}",test); }