In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection. Note that a dictionary is also known as a map.
The dictionary problem is a classic computer science problem: the task of designing a data structure that maintains a set of data during 'search', 'delete', and 'insert' operations. There are many different types of implementations of dictionaries.
Dictionaries are not a silver bullet and should not be used at every chance you get. They are useful in many scenarios, but you need to keep the following points in mind before deciding to use a dictionary to solve a problem.
Dictionaries generally have a well-defined APIs. We're going to implement a very basic dictionary API as defined below −