4 ms·
Which makes it useless, since despite their teaching-programming popularity, linked lists aren't actually good for anything. The useful kind is called intrusiv
by astrange 3y ago
Which makes it useless, since despite their teaching-programming popularity, linked lists aren't actually good for anything.
The useful kind is called intrusive linked lists, but nobody teaches those.
- consilient 3y agoIntrusive linked lists trade away simplicity and ease of refactoring for better memory characteristics. There's a huge amount of code where that trade is a terrible deal. Obviously you shouldn't use ordinary linked lists deep in the guts of an OS kernel or automated trading system but claiming that they're useless is absurd.
- astrange 3y agoThe main issue is that a list of pointers is inefficient but also overkill; a small list is probably fine as an array even if you're mutating it. But intrusive lists also have clearer ownership, since the object knows all the lists it can be in, and that's handy sometimes.