I'm trying to find the largest value in a std::map, which would be the last node in the tree (since std::map keys are sorted).
Cppref says std::map.end() is constant time. But to get the largest key, I must get the previous value of this iterator, i.e. *std::prev(std::map.end()).
What's the time complexity of that operation?
I understand that this should equivalent to --std::map.end(), but I don't know the cost of that operation either.