Updated insert method to allow items to be added to the end of the list.

This commit is contained in:
2022-03-23 21:20:19 +00:00
parent 7bb55b8845
commit 1db992492b
2 changed files with 7 additions and 3 deletions

View File

@ -29,14 +29,15 @@ list.Append(3);
list.Append(4);
list.Append(5);
list.Append(6);
list.Insert(6, 1);
Console.Write($"{list[0]} ");
Console.Write($"{list[1]} ");
Console.Write($"{list[2]} ");
Console.Write($"{list[3]} ");
Console.Write($"{list[4]} ");
Console.Write($"{list[5]} \n");
Console.Write($"{list[6]} ");
Console.Write($"{list[5]} ");
Console.Write($"{list[6]} \n");
//DoublyLinkedList<int> list2 = new DoublyLinkedList<int>();