Question on maps stl...

c
c-plus-plus
maps
ordered
stl
unordered

#1

What is the difference between ordered map and unordered map?


#2

One of them uses a red-black tree to sort out the map’s keys such that searching for a key takes O(log(N)) in time complexity. The other one uses a hash to store the map’s keys such that searching for a key takes O(1) in time complexity. You know which is which :wink:


#3

Answers to such questions can be simply googled.