3 ms·
I'd agree with that in the general case, but in the situation as given I think there's not much benefit to using a linked list. Perhaps ergonomics, but that's
by reificator 9y ago
I'd agree with that in the general case, but in the situation as given I think there's not much benefit to using a linked list.
Perhaps ergonomics, but that's subjective and relative to the codebase in question, and I tend to prefer the ergonomics of a vector personally.
If you have an example of why a linked list would be a better choice in a given situation, I'd love to learn more.
Here's an example performance graph, but I encourage you to try it yourself if you're curious: https://www.codeproject.com/KB/cpp/340797/linux_insert1.png https://www.codeproject.com/KB/cpp/340797/linux_insert1.png
- blowski 9y agoI’ll assume you’re right as I have no knowledge in this area. My suggestion was just how I would handle the question in an interview.
- reificator 9y agoI'm in a much more dangerous position: I have a little knowledge in that area.