Esempio n. 1
0
        static void Main(string[] args)
        {
            var test = new CSharpLinkedList <int>();
            var data = Enumerable.Range(1, 50).ToList();

            foreach (var i in data)
            {
                test.AddLast(i);
            }
            Console.WriteLine(test.Count);

            foreach (var i in data.Where(d => d % 2 == 0))
            {
                test.Remove(i);
            }
            Console.WriteLine(test.Count);

            test.Print();

            foreach (var i in data.Where(d => d % 3 == 0))
            {
                test.Remove(i);
            }
            Console.WriteLine(test.Count);

            test.Print();

            Console.ReadKey();
        }
Esempio n. 2
0
 //初始化
 public CSharpLinkedListEnumerator(CSharpLinkedList <T> data)
 {
     list = data;
     node = list.head;
 }