Answers for "find and count in map time complexity"

1

std map count vs find

In general, both count and find will use the container-specific lookup methods (tree traversal or hash table lookup), which are always fairly efficient. It's just that count has to continue iterating until the end of the equal-range, whereas find does not. Moreover, your code should document intent, so if you want to find something, use find.
Posted by: Guest on May-12-2020

Code answers related to "find and count in map time complexity"

Browse Popular Code Answers by Language