3 ms·
The problem with linked lists is that they are rarely the ideal solution to any problem. They are convenient in C, because of C’s inadequacies, but in C++ and R
by zarzavat 4y ago
The problem with linked lists is that they are rarely the ideal solution to any problem. They are convenient in C, because of C’s inadequacies, but in C++ and Rust they are marginalized because the tools exist to use superior data structures.
You almost always want to unroll your linked linked lists, so that items are fetched in blocks. But this rarely happens in C because it’s premature optimization in C. In C++ or Rust you can write the code once in a generic data structure and enjoy the benefits to the end of time.
That all said, I think we should still teach them in CS because understanding linked lists is the first step to understanding trees.