Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
4 views
in Python by (47.6k 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 (106k points)
edited 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:-

Browse Categories

...