From 2c2f2919f8b8b8e331500056298eaa85f0085db8 Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Tue, 7 Nov 2023 01:53:47 -0500 Subject: [PATCH] adding notes about unordered_map/set --- lectures/20_hash_tables_I/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lectures/20_hash_tables_I/README.md b/lectures/20_hash_tables_I/README.md index 89b2bbd..4913dea 100644 --- a/lectures/20_hash_tables_I/README.md +++ b/lectures/20_hash_tables_I/README.md @@ -219,11 +219,13 @@ More generally, the jth “probe” of the table is (i + c1j + c - The Standard Template Library standard and implementation of hash table have been slowly evolving over many years. Unfortunately, the names “hashset” and “hashmap” were spoiled by developers anticipating the STL standard, so to avoid breaking or having name clashes with code using these early implementations... -- STL’s agreed-upon standard for hash tables: unordered_set and unordered_map. -- Depending on your OS/compiler, you may need to add the -std=c++11 flag to the compile line (or other +- STL’s agreed-upon standard for hash tables: unordered_set and unordered_map. +- You can use std::unordered_set the same way as you use std::set, even though the internal of these two are different, the external interface are the same. +- You can use std::unordered_map the same way as you use std::map, even though the internal of these two are different, the external interface are the same. +