Updated insert method to allow items to be added to the end of the list.
This commit is contained in:
@ -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>();
|
||||
|
Reference in New Issue
Block a user