Contents    Page-10    Prev    Next    Page+10    Index   


We have seen that an array is the best way to implement a map if the key type is integer and the range of possible keys is not too large: access to an array is O(1).

What if the key type does not fit these criteria? The idea of hashing is to use a hash function          h: KeyType → integer