Which container guarantees elements are stored in sorted key order?
- A std::unordered_map
- B std::map
- C std::vector
- D std::unordered_set
Answer
std::map
std::map is typically a red-black tree, giving O(log n) operations and ordered iteration. unordered_map gives no ordering at all.





