From debde7a283aa9bd1fefbf04cda2b546780067b3a Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Fri, 20 Oct 2023 10:51:24 -0400 Subject: [PATCH] const in map pairs --- lectures/15_maps_I/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lectures/15_maps_I/README.md b/lectures/15_maps_I/README.md index 8de4f60..c819ba3 100644 --- a/lectures/15_maps_I/README.md +++ b/lectures/15_maps_I/README.md @@ -23,8 +23,7 @@ text file on which that string occurs (next lecture). std::map<key_type, value_type> var_name In our first two examples above, key type is a string. In the first example, the value type is an int and in the second it is a std::vector<int>. -- Entries in maps are pairs: -std::pair<const key_type, value_type> +- Entries in maps are pairs: std::pair<const key_type, value_type>, or just std::pair<key_type, value_type>. - Map iterators refer to pairs. - Map search, insert and erase are all very fast: O(log n) time, where n is the number of pairs stored in the map. Note: The STL map type has similarities to the Python dictionary, Java HashMap, or a Perl hash, but the