3 ms·
Linked lists would only be unintuitive if you wanted to apply them to a sequential block of memory like that. Linked lists are used in non-sequential blocks of
by Jtsummers 11y ago
Linked lists would only be unintuitive if you wanted to apply them to a sequential block of memory like that. Linked lists are used in non-sequential blocks of memory, though you can use them in sequential blocks. It sometimes makes sense to, but really only in an embedded systems context where you're doing some other fun things like writing your own memory management system using preallocated arrays as heaps so that your memory usage doesn't grow unbounded.
- Veedrac 11y agoI'm aware there are circumstances where linked lists are useful, but IMHO they're rarely introduced alongside a context that justifies them. Unintuitive doesn't mean bad, FWIW.
- Jtsummers 11y agoI wrote that after a very, very long day and long after I should've gone to bed (stupid needing to wear clothes, and not wanting to wear dirty clothes). The main point I wanted to make was that you described linked lists as unintuitive specifically in the context of having access to sequential memory space. Linked lists are not, typically, used in that circumstance. They make much more sense, and I think become more intuitive, when you consider them in the context of non-sequential memory space.