Dictionary

noun

say it: “DIK-shuh-nair-ee” /ˈdɪkʃəˌnɛri/

A collection that stores values under unique keys and finds a value by its key, such as C#'s Dictionary, Java's HashMap, Python's dict or JavaScript's Map.

What is a dictionary?

A dictionary stores values under keys, the way a real dictionary keeps a definition under each word. Every language has one built in, and it's a hash table: adding, reading, updating and removing by key are O(1) on average. Don't count on its order; sort the keys when order matters.

In a sentence

  • “Instead of looping through the members to find Maya, keep them in a dictionary and look her up by name.”

Level: Apprentice · More Data Structures terms at this level

Updated

In other subjects