2 ms·
Can you clarify what's "terrible" about it? Provided a hash function for the key type exists, the hash map is one valid implementation for a generic map from k
by jstimpfle 8y ago
Can you clarify what's "terrible" about it?
Provided a hash function for the key type exists, the hash map is one valid implementation for a generic map from keys to values. An array is a more efficient map from keys to values if the key type is an integral type and the actual keys at runtime are contiguous. It's also efficient if the keys are only nearly contiguous, and we have a "N/A" sentinel in the value type.