Learn C++ STL

Lesson 8 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

Cheat Sheet: unordered_set and unordered_map on One Page

ProReading

This page is the module on one sheet, for the moment before a contest or an interview. Every line here was taught, measured or run in lessons 01 to 06, and the set and map column in Modules 8 and 9. Nothing is new. Print it, or keep it open beside the editor.

Checking what this lesson needs for you…

What is inside Cheat Sheet: unordered_set and unordered_map on One Page

  1. Declaring the hash containers
  2. Every operation and its cost
  3. How a look finds its bucket
  4. GCC 12's bucket numbers
  5. The six idioms
  6. What a rehash breaks
  7. Which container, in one table
  8. The nine traps

Module test

Ten questions on this module. Pass at 70%, and you can take it as many times as you like.

Take the module test