Learn C++ STL

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

Full Programs: From a Door List to a Symbol Table

Free with an accountReading

Most programs ask one small question again and again: have I seen this before, and what do I know about it? A hash container answers it in about one step on average, however much it holds. Six programs follow, from the front door of a party to the symbol table inside a calculator. Each one is a little bigger and adds one new idea. Read the "new thing" line above each program first; it is what that program is for.

Checking what this lesson needs for you…

What is inside Full Programs: From a Door List to a Symbol Table

  1. Program 1: the door list of a party
  2. Program 2: a small id for every city
  3. Program 3: a stock table sized before it fills
  4. Program 4: a sparse matrix as a dictionary of keysIntermediate
  5. Program 5: the symbol table of a tiny calculatorIntermediate
  6. Program 6: a struct as a key, the seats of a trainIntermediate