3 ms·
> Most of my peers didn't understand the "fundamentals". They didn't know a map was implemented as a binary tree, for example. I mean, I don't use c++ much, bu
by justin66 3y ago
> Most of my peers didn't understand the "fundamentals". They didn't know a map was implemented as a binary tree, for example.
I mean, I don't use c++ much, but... the "fundamentals" are that an unordered map is probably implemented as a hash table, and an ordered map could be implemented on a trie, a vector, a linked list, some other thing I can't think of right now, or... some variety of a binary tree. Right? I don't think I would want to assume.
- BeetleB 3y ago> and an ordered map could be implemented on a trie, a vector, a linked list, some other thing I can't think of right now, or... some variety of a binary tree. Right? I don't think I would want to assume. You're correct in that one shouldn't assume a red-black tree. However, the standard does dictate O(...) performance for the map, which strongly suggests an underlying structure. And as I point out in another comment: Knowing that it was indeed a tree helped me debug an issue where I ran out of RAM. In any case, you're point strengthens mine: That you don't need to know "fundamentals" to program in C++.