Recently a coworker showed me some code he had written with a LinkedList and I couldn’t get my head around it.
a -> b -> c -> d -> e -> f
If I want to get d from the LinkedList, don’t I have to traverse the list starting with a and iterating up to d or starting with f and iterating back to d?
Why would I care WHERE d is stored physically in the Collection?
Not every linked list is linked in both directions but, normally, yes. This type of collection features sequential access in the forward or forward and reverse directions.
The advantages are: