public void Concat(LinkListGen <T> list2) { var temp = list2.list; while (temp != null) { AppendItem(temp.Data); temp = temp.Next; } }
private static void Main(string[] args) { var list = new LinkListGen <string>(); list.AppendItem("Hello World!"); list.AppendItem("My name is"); list.AppendItem("Elliot Lewis."); list.AppendItem("And this is a"); list.AppendItem("Test List!"); list.Sort(); Console.WriteLine(list.DisplayList()); Console.ReadKey(); }
public void Copy(LinkListGen <T> list2) { list = null; Concat(list2); }