mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-14 02:34:17 +02:00
Merge pull request #3321 from ankushagarwal/patch-1
[c++/en] Add comments about unordered_map and unordered_set
This commit is contained in:
@@ -1057,6 +1057,8 @@ cout << ST.size(); // will print the size of set ST
|
|||||||
// Output: 0
|
// Output: 0
|
||||||
|
|
||||||
// NOTE: for duplicate elements we can use multiset
|
// NOTE: for duplicate elements we can use multiset
|
||||||
|
// NOTE: For hash sets, use unordered_set. They are more effecient but
|
||||||
|
// do not preserve order. unordered_set is available since C++11
|
||||||
|
|
||||||
// Map
|
// Map
|
||||||
// Maps store elements formed by a combination of a key value
|
// Maps store elements formed by a combination of a key value
|
||||||
@@ -1084,6 +1086,8 @@ cout << it->second;
|
|||||||
|
|
||||||
// Output: 26
|
// Output: 26
|
||||||
|
|
||||||
|
// NOTE: For hash maps, use unordered_map. They are more effecient but do
|
||||||
|
// not preserve order. unordered_map is available since C++11.
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// Logical and Bitwise operators
|
// Logical and Bitwise operators
|
||||||
|
Reference in New Issue
Block a user