3 ms·
You mean like the built in `set` object? https://docs.python.org/2/library/stdtypes.html#set https://docs.python.org/2/library/stdtypes.html#set
by Spiritus 12y ago
You mean like the built in `set` object? https://docs.python.org/2/library/stdtypes.html#set https://docs.python.org/2/library/stdtypes.html#set
- omaranto 12y agoI think he or she meant a specialized set data structure that stores sets of numbers which can be written as finite unions of interval. Typically besides set operations you'd also want (1) that only endpoints of the intervals are stored, so that the structure is compactly represented in memory, (2) to be able to recover the canonical representation of the set as a sorted union of disjoint intervals.
- TheLoneWolfling 12y agoThis is exactly what I meant, thank you.
- TheLoneWolfling 12y agoSet doesn't work for this. You need to store all possible numbers between the lower and upper bound, which isn't exactly workable for (for example) floats.