Which of the following containers is have search complexity O(n)?
std::set has logarithmic complexity (red-black tree). The complexity of std::hash_set depends heavily on the implementation of the hashing function, but it is tried to be selected in such way that the element is accessed with constant complexity.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Зареєструйся Зараз
або Підпишись на майбутні тести