Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the average lookup complexity of std::unordered_map?

  1. A O(1)
  2. B O(log n)
  3. C O(n)
  4. D O(n log n)
Answer

O(1)

unordered_map is a hash table with O(n) worst case. std::map is a balanced tree with guaranteed O(log n) and sorted iteration.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as