Quick A: The unordered_* containers have average O(1) complexity.
Recently on SO:
data structure with O(1) search time complexity in c++
What you want is C++11's std::unordered_map, with an average access time of O(1) and a worst case of O(n).
June 16-21, Sofia, Bulgaria
September 13-19, Aurora, CO, USA
November 6-8, Berlin, Germany
November 16-21, Kona, HI, USA
By Adrien Hamelin | Oct 15, 2018 12:27 PM | Tags: c++11 basics
Quick A: The unordered_* containers have average O(1) complexity.
Recently on SO:
data structure with O(1) search time complexity in c++
What you want is C++11's std::unordered_map, with an average access time of O(1) and a worst case of O(n).
There are currently no comments on this entry.
Add a Comment
Comments are closed.