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).
March 18-23, Tokyo, Japan
April 17-20, Bristol, UK
April 24-26, Leganes, Spain
April 30, Online
May 7-12, Aspen, CO, USA
June 24-29, St. Louis, MO, USA
July 2-5, Folkestone, Kent, UK
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.