๐Ÿ“˜

Hashing

Turning a key into a number that tells you where to store or find something.

๐Ÿ˜Š In simple words

Turning a key into a number that tells you where to store or find something.

๐ŸŽ“ Technical definition

Applying a hash function to a key to compute an index into a table, giving near-constant-time lookups in maps and sets.

Pseudocode example
1SET PHONE = {"Ali": "555-1234"}2DISPLAY PHONE["Ali"]

๐ŸŽ Real-world analogy

A cloakroom ticket number that tells you exactly which hook holds your coat.

๐Ÿ”— Related concepts

โ† Whole glossary