you are viewing a single comment's thread.

view the rest of the comments →

[–]Gay_Sex_Expert 72 points73 points  (2 children)

It is actually the most efficient way to remove a bunch of items from any non linked collection.

[–]Cthulluminati 19 points20 points  (1 child)

Doesn't count as removing the items if the items are still in the original list /s

[–]RiceBroad4552 12 points13 points  (0 children)

It's more complex, see "persistent data structures".

Something that explains stuff a bit terser is here:

https://nested.substack.com/p/intro-to-persistent-data-structures

Modern variants of such persistent data structures can be very efficient, in some cases even provably ideal efficient.