News for hackers. Stuff that matters.
Re:I Accidentally a Scheme by cnity on Wednesday November 15, 2023 @04:23AM (#38274822)
> Neither is conducive to efficiently removing elements mid-set, or composing two sets, or interleaving two sets, or other operations that require reordering, replacing, adding or removing elements in the set

Read this: https://isocpp.org/blog/2014/06/stroustrup-lists

Re:I Accidentally a Scheme by dleslie on Wednesday November 15, 2023 @09:59AM (#38277276)
That's based around a contrived problem that was posed to him:

> Insert a sequence of random integers into a sorted sequence, then remove those elements one by one as determined by a random sequece of positions: Do you use a vector (a contiguously allocated sequence of elements) or a linked list?

The key is that the sequence is sorted; and is kept sorted throughout the insertion process. With a linked list that means at least an O(n) traversal for insertion, so of course it's terrible.