-2

So at the job interview I was asked the following question:

In Python, the word 'dictionary' is a reserved pythonic word for this data structure. But what is its "real" name? What is python dictionary in other programming languages?

Googling doesn't point me to what I'm actually looking for. Can anybody explain it?

Paolo
  • 20,112
  • 21
  • 72
  • 113
Desiigner
  • 2,136
  • 5
  • 26
  • 47

2 Answers2

1

Your interview question is wrongly worded. Dictionary IS the proper name of the abstract data structure that allows you to look up something based on a key. Python used the exact name of the ADT in its implementation. Another way to call the abstraction is “associative array”.

Internally, dictionaries in Python are implemented as a hash table , which is NOT an ADT (hash a key and look it’s value up in the bucket that matches its hash). You can have dictionaries with a different implementation (e.g. tree based).

OHHH
  • 1,011
  • 3
  • 16
  • 34
0

Quoting the docs I'd say:

Dictionaries are sometimes found in other languages as “associative memories” or “associative arrays”.

Paolo
  • 20,112
  • 21
  • 72
  • 113