示例#1
0
        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();
        }
示例#2
0
文件: Program.cs 项目: SergioFaya/TPP
        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();
        }