Using LinkedLists in a .NET console application Part 3 – Find and update
1 min read

Using LinkedLists in a .NET console application Part 3 – Find and update

Let’s locate a node and add elements prior to the node.

First find the node with the string fox.

LinkedListNode<string> current = sentence.Find("fox");

Next we add quick and brown before.

sentence.AddBefore(current, "big");
sentence.AddBefore(current, "brown");

Awesome! Now iterate over the LinkedList again and check the result.

Perfect! Now go out and make some LinkedLists, it’s free!

Leave a Reply