4 ms·
Hashtables are unordered by key, so if you want ordering for those keys, which would really be the set elements, you'll have to sort.
by Volt 10y ago
Hashtables 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.