5 ms·
> Neither is conducive to efficiently removing elements mid-set, or composing two sets, or interleaving two sets, or other operations that require reordering, r
by cnity 3y ago
> 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 https://isocpp.org/blog/2014/06/stroustrup-lists
- dleslie 3y agoThat'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.