Learn C++ STL

Lesson 4 of 9 · unordered_set and unordered_map: Hashing, Collisions and the Anti-Hash Test

Module 10 · unordered_set and unordered_map: Hashing, Collisions and the Anti-Hash Test

When to Use a Hash Container, a Tree or a Plain Array, and When Not To

Free with an accountReading

Kenji uses unordered_map for everything, even for quiz questions numbered 1 to 1000. Maria keeps a map for her word list, though nobody ever walks it in order. Both programs work. Amara asks each of them one question: what did the job need? This lesson is her answer, with a chart, a flowchart, two measurements and one set of keys built to hurt.

Checking what this lesson needs for you…

What is inside When to Use a Hash Container, a Tree or a Plain Array, and When Not To

  1. Five questions before you pick
  2. The comparison chart
  3. The decision flowchart
  4. A million keys, measured
  5. A handful of keys, measured
  6. When someone else chooses the keys
  7. When not to use a hash container
  8. The honest default