Using LinkedLists in a .NET console application Part 2 – Add and remove nodes
1 min read

Using LinkedLists in a .NET console application Part 2 – Add and remove nodes

Now it’s time to add a new word to the beginning of the list.

sentence.AddFirst("today");

If you iterate over the list again you will see that today is added as the first element in the linked list.

Now let’s create a LinkedListnode containing the node we just created, remove it from the beginning and add it last.

In the next post we’ll search the node and add elements to it.

Leave a Reply