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 11-13, Online
March 16-18, Madrid, Spain
March 23-28, Croydon, London, UK
May 4-8, Aspen, CO, USA
May 4-8, Toronto, Canada
June 8 to 13, Brno, Czechia
June 17-20, Folkestone, UK
September 12-18, Aurora, CO, USA
November 6-8, Berlin, Germany
November 16-21, Búzios, Rio De Janeiro, Brazil
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.