“multiset” & “multimap” - What's the point?

后端 未结 7 1700
孤城傲影
孤城傲影 2020-12-08 18:58

As the question states ... I don\'t get the point about multisets / multimaps.

So, what\'s the purpose?

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 19:29

    The most important benefit of using a multiset over a vector/list(or any other container) is the time complexity of find operation. average case time complexity for multiset is O(logn) and unordered_multiset is O(1). Same is true for multimap and ordered_multimap.

提交回复
热议问题