4 ms·
For deletion, I think you can augment the current data structure so that instead of just storing each value, you pair it up with a Boolean telling whether the v
by nayuki 3y ago
For deletion, I think you can augment the current data structure so that instead of just storing each value, you pair it up with a Boolean telling whether the value is actually still included or not.
But you lose out on insertion and search efficiency; the worst case is dependent on the maximum number of values ever inserted, not the number of currently valid values.
- mehrdadn 3y agoThe reason I mentioned using a hierarchical bitmap was precisely the inefficiency of just having one bool per element.