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

@ -105,9 +105,12 @@ namespace C_.Datastructures
}
//Set tail to new item if index is the end
if (index == Count)
if (index == Count - 1)
{
//Decrement count as it will be be re-incremented once appended
Count--;
Append(value);
return;
}
//Fetch point in list and add new item