1HASH TABLES

Image

It’s amazing how often computer programs need to search for information, whether it’s to find a user’s profile in a database or to retrieve a customer’s orders. No one likes waiting for a slow search to complete.

In this chapter, we’ll solve two problems whose solutions hinge on being able to perform efficient searches. The first problem is determining whether or not all snowflakes in a collection are identical. The second is determining how many passwords can be used to log in to someone’s account. We want to solve these problems correctly, but we’ll see that some correct approaches are simply too slow. We’ll be able to achieve enormous ...

Get Algorithmic Thinking, 2nd Edition 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.