10 Hash Tables

This chapter introduces hash tables, dynamic data structures hyper-optimized for insertions and lookups. Hash tables use mathematical functions to point us toward the data’s location. They are particularly useful in pure storage cases where the goal is to find and retrieve information quickly.

This is the type of tradeoff we might want to make for our coffee pantry. Forget trying to sort coffees by expiration date or tastiness—we are true coffee aficionados who effortlessly remember the smallest details of every bean in our pantry. For any given attribute (or combination of attributes), we can instantly remember the coffee’s ...

Get Data Structures the Fun Way now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.