3 ms·
Trees and Lists are types of data structures. Both are very useful in all contexts. Linked List is a special kind of List. It typically implies a non-sequentia
by yazaddaruvala 7y ago
Trees and Lists are types of data structures. Both are very useful in all contexts.
Linked List is a special kind of List. It typically implies a non-sequential data layout.
With all of the modern layers of abstraction, non-sequential memory access typically means poor cache friendliness, i.e. poor performance.
Hopefully that helps explain why Linked Lists are considered niche, I.e. specific to embedded programming or in very special cases when benchmarks provide hard data to use a Linked List.
- varjag 7y agoTree is a special case of a linked list. Linked list is definitely sequential (it's a list!), and it can even be sequentially allocated in memory, depending on allocator implementation.
- dpbriggs 7y agoThat's not necessary true. You can implemented binary trees as an array, so are trees a special case of arrays? There can be sequential and non-sequential implementations of ADTs.