2 ms·
To me set implies the mathematical definition of a Set, not just a lists that prevents duplicates. As such it should be optimized for the various set operations
by leecarraher 10y ago
To me set implies the mathematical definition of a Set, not just a lists that prevents duplicates. As such it should be optimized for the various set operations: union, intersect, compliment, sym_difference, isdisjoined, issubset.
for just avoiding non-duplicates a list and a bloom filter is probably a faster data structure than a set.
- kazinator 10y agocomplEment is tricky. How do you propose that it be encoded? You don't literally want to create a complement set and populate it with every possible object that is not in the original set (but could be, according to type). A clone of the set with a complement flag? That could work. At least until someone constructs a complement of a set, and then wants to iterate over it, oops!