DEV Community

Discussion on: Complete Introduction to the 30 Most Essential Data Structures & Algorithms

Collapse
 
xtofl profile image
xtofl

A gigantic work.

Being a C++ nerd, I have to correct: std::map has logarithmic access complexity (mandated by the standard, e.g. see cppreference). If you're looking for a constant complexity data structure, the 'hashmap' is std::unordered_map.

Collapse
 
iuliagroza profile image
Iulia Groza

Thank you, well pointed out! I haven't noticed I considered the map's access operation to be done in O(1) (in the Maps presentation photo). As you've highlighted the logarithmic complexity, maps are indeed implemented using self-balancing trees (mentioned it in the properties). Going to fix my mistake.