Chapter 11 Flashcards
dictionary
a mapping from a set of keys to their corresponding values
key-value pair
the representation of the mapping from a key to a value
item
another name for a key-value pair
key
an object that appears in a dictionary as the first part of a key-value pair
value
an object that appears in a dictionary as the second part of a key-value pair. This is more specific than our previous use of the word ‘value’.
implementation
a way of performing a computation
hashtable
the algorithm used to implement Python dictionaries.
hash function
a function used by a hashtable to compute the location for a key
hashable
a type that has a hash function. Immutable types like integers, floats, and strings are hashable; mutable types like lists and dictionaries are not.
lookup
a dictionary operation that takes a key and finds the corresponding value.
reverse lookup
a dictionary operation that takes a value and finds one or more keys that map to it.
singleton
a list (or other sequence) with a single element.
call graph
a diagram that shows every frame created during the execution of a program, with an arrow from each caller to each callee.
histogram
a set of counters
memo
a computed value stored to avoid unnecessary future computation