private void TestDoubleLinkedList() { MyDoublyLinkedList list1 = new MyDoublyLinkedList(); list1.Add(4, 0); list1.Add(3, 0); list1.Add(1, 0); list1.Add(2, 1); list1.Add(5, 4); list1.Traverse(); list1.Delete(3); list1.Traverse(); list1.Delete(1); list1.Traverse(); list1.Delete(0); list1.Traverse(); WriteLine(); var list2 = new MyDoublyLinkedList(); list2.Add("mot", 0); list2.Add("hai", 1); list1.Add(2, 0); var list = list1 + list2; list.Traverse(); WriteLine(); try { list.Add("data", 50); } catch (IndexOutOfRangeException e) { WriteLine(e.Message); } try { (new MyDoublyLinkedList()).Delete(0); } catch (InvalidOperationException e) { WriteLine(e.Message); } }