4 ms·
Okay... the sequence has length measured in the billions, and we want to be able to rapidly remove its elements, or insert new elements in front of existing el
by xamuel 11y ago
Okay... the sequence has length measured in the billions, and we want to be able to rapidly remove its elements, or insert new elements in front of existing elements.
Suddenly linked lists (doubly-linked) are looking pretty intuitive :)
- Veedrac 11y agoI'm not convinced. I obviously can't say what I'd do if I had to think these up, but I think I'd be more likely to try and impart ordering on a contiguous array than building a multiple-allocation one. Going down this route would probably result in a contiguous linked list. You can argue that this is still a linked list, but I still find it conceptually more obvious. For a billion elements, it's probably also a lot faster, too.