示例#1
0
        static void printList(LinkedListItem root)
        {
            LinkedListItem x = root;
            do
            {
                if (x!=null) Console.WriteLine(x.Id);
                //x = root.Next;
            } while ((x = x.Next)!=null);
            

        }
示例#2
0
 static LinkedListItem generateData()
 {
     LinkedListItem root = new LinkedListItem(1, "Item 1");
     LinkedListItem previous = root;
     for (int i = 2; i < 10; i++)
     {
         LinkedListItem next = new LinkedListItem(i, string.Format("Item {0}", i));
         previous.Next = next;
         previous = next;
     }
     return root;
 }
示例#3
0
 static LinkedListItem reverseList(LinkedListItem root)
 {
     return null;
 }