private void RunTheLinkedList() { LinkedList ll = new LinkedList(15); // Inserting a few variables here ll.Insert(16); ll.Insert(17); ll.Insert(18); ll.Insert(19); ll.Insert(20); Console.WriteLine(ll.ToString()); // Deleting the head ll.DeleteHead(); Console.WriteLine(ll.ToString()); // Deleting the tail ll.DeleteTail(); Console.WriteLine(ll.ToString()); // Deleting a specific element try { ll.Remove(21); // Should say it wasn't found ll.Remove(18); // It should find this one and delete it Console.WriteLine(ll.ToString()); } catch (Exception e) { Console.Write("Exception: " + e.ToString()); } Console.WriteLine("Does the linked list contain 17? " + ll.Contains(17)); // Should return true Console.WriteLine("Does the linked list contain 3? " + ll.Contains(3)); // Should return false }