5 ms·
If by "list" you mean "linked list", then those are never used in practice. There is no place for this data structure in a modern CS toolbox.
by otabdeveloper4 4y ago
If by "list" you mean "linked list", then those are never used in practice. There is no place for this data structure in a modern CS toolbox.
- drdec 4y agoThe people behind the Elixir programming language certainly disagree.
- otabdeveloper4 4y agoMaybe that's why Elixir never gained real traction.
- mtlmtlmtlmtl 4y agoThat's a ridiculous statement. Linked lists have real performance benefits in some applications. A good "modern CS toolbox" includes the ability to make the right choice. Which, if you believe they are fundamentally useless, clearly you lack.
- otabdeveloper4 4y ago> Linked lists have real performance benefits in some applications. Maybe in 0.01% of the cases. In reality they just ruin your cache and memory allocator performance for no real good reason.
- mtlmtlmtlmtl 4y agoIn many cases you can get around these issues by being a little more clever in how you allocate nodes. In some cases you don't have the luxury of allocating all elements next to eachother anyway, in which case an intrusive linked list is often the best option to minimise copying. You might say use a vector of pointers or a circular buffer, but if you're in a timing sensitive context you might be unable to realloc. Hell, memory allocators themselves are often implemented using some form of linked list. You tend to see them quite a bit at very low levels like in kernels.