5 ms·
It would be interesting to see how things compared with set operations on hash table keys and `sort`.
by GregBuchholz 10y ago
It would be interesting to see how things compared with set operations on hash table keys and `sort`.
- codr4life 10y agoCould you elaborate on that a bit? First I thought you wanted to compare to a straight hash table but then the sorting threw me off :)
- Volt 10y agoHashtables are unordered by key, so if you want ordering for those keys, which would really be the set elements, you'll have to sort.
- codr4life 10y agoI get it, hash table for membership and manual ordering. That's an option. From my experience; hashed sets are more expensive to set up, because of the slots; making small repetitive sets less appealing. And manual ordering is not always an option. I tried adding hashing on top of slists, an array of slists basically; to get away from traversing the whole thing for large sets; but the results were disappointing, basically identical performance.