Sorting Algorithm used in stl map?

Hi everyone,

if anyone knows which sorting algorithm used in c++ stl map. please let me know....


Thanks in advance
C++ standard does not enforce any kind of implementation of standard libraries, as long as they perform as specified. Different implementations may use different algorithms. Moreover, the obvious implementation of a map is a binary search tree and does not involve any sorting (I guess you could consider insert() a sorting algorithm.. Anyway, look into binary search trees and you'll see how that works.).
Last edited on
std::map is most commonly implemented as a red-black tree, although as hamsterman said, this is not mandated by the standard.
Topic archived. No new replies allowed.