3 ms·
This is a rather useless data structure: You can only store integers and they must be in the range of [0, n>. The simple operations are O(1), because you can j
by rjprins 18y ago
This is a rather useless data structure:
You can only store integers and they must be in the range of [0, n>.
The simple operations are O(1), because you can just map the positions of all integers based on their value in a second array of size n.
- tptacek 18y agoYou're not using it to replace a container ADT. You're using it for a low-overhead fast membership test. When things only store integer keys, usually that implies that you have a fast integer-keyed store for the rest of the information. Most trie implementations work the same way.
- babo 18y agoThe cheap iteration is a big plus of this data structure over a simple set.