static void printList(LinkedListItem root) { LinkedListItem x = root; do { if (x!=null) Console.WriteLine(x.Id); //x = root.Next; } while ((x = x.Next)!=null); }
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; }
static LinkedListItem reverseList(LinkedListItem root) { return null; }