3 ms·
Hash tables are more often the right interface than the right data structure
- magicalhippo 2y agoNot quite sure what to take away from this brief sentence. By "hash table interface" does one include the O(1) lookups? That the elements must implement equality comparison and a hash value function? Or simply just generic non-ordered key-value store? Often one just needs a key-value store, and O(log n) access is sufficient. Other times one needs the O(1). Sometimes the elements can't be compared for equality, but can be ordred. But yes, dictionaries are very useful.