static void Main(string[] args) { LinkedListInt.LinkedListInt list = new LinkedListInt.LinkedListInt(); int x = 10; while (x != 0) { list.Add(x); x--; Console.WriteLine(list.ToString()); Console.WriteLine("Elements:" + list.NumberOfElements); } x = 5; while (x != 0) { list.Remove(x); Console.WriteLine(list.ToString()); Console.WriteLine("Elements:" + list.NumberOfElements); x--; } Console.WriteLine("Final" + list.ToString()); Console.ReadLine(); }
static void Main(string[] args) { LinkedListInt.LinkedListInt list = new LinkedListInt.LinkedListInt(); list.Add(5); list.Add(8); list.Add(1); Console.WriteLine(list.ToString()); list.Remove(2); list.Remove(1); Console.WriteLine(list.ToString()); Console.WriteLine(list.NumberOfElements); Console.ReadLine(); }