+1 vote
1 view
in Python by (20.2k points)

Does anyone know how the built in dictionary type for python is implemented? My understanding is that it is some sort of hash table, but I haven't been able to find any sort of definitive answer.

1 Answer

0 votes
by (50.6k points)
edited ago by

Below is the all possible answers related to Python's Built In Dictionaries Implemented:-

  • The Python dictionaries are implemented the same as the hash tables.

  • The Hash tables must allow for hash collisions i.e. even if two distinct keys have the same hash value, the table's implementation must have a strategy to insert and retrieve the key and value pairs unambiguously.

  • The Python dict uses open addressing to resolve hash collisions

To know more about this you can have a look at the following video:-

...