static void Main(string[] args) { Console.WriteLine("Hello World!"); Console.WriteLine("Add First:"); LinkList List = new LinkList(); List.AddToHead(new Node("Hello")); List.AddToHead(new Node("Crazy")); List.AddToHead(new Node("World")); List.PrintAllNodes(); Console.WriteLine(); Node New = new Node("Lisa"); Node Search = new Node("World"); List.AddBefore(New, Search); List.AddAfter(new Node("Lisa"), Search); List.PrintAllNodes(); Console.WriteLine(); Console.WriteLine(List.Includes("Crazy")); Console.WriteLine("Add Last:"); List.Append(new Node("Don't")); List.Append(new Node("Be")); List.Append(new Node("Last")); List.PrintAllNodes(); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); LinkList link = new LinkList(); link.Insert(5); link.Insert(12); link.Insert(43); link.Insert(3); bool result = link.Includes(5); Console.WriteLine(result); Console.WriteLine(link.ToString()); Console.WriteLine(link.KthFromEnd(2)); }