See this video from Stroustrup on how big N should be for which a linked list outperforms a vector: Bjarne Stroustrup: Why you should avoid Linked Lists - YouTube. TLDR: always go with a vector unless you know the linked list performs better because you've measured it.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Noob question again: why a vec? | 76 | 4357 | January 16, 2024 | |
`indexlist`: a doubly linked list backed by a vector | 4 | 2318 | January 12, 2023 | |
Need collection with insert and remove anywhere | 17 | 2402 | April 25, 2022 | |
Why is vec in different namespace than LinkedList
|
24 | 1309 | January 16, 2021 | |
Advice regarding vector memory efficiency | 12 | 913 | July 26, 2023 |