News for hackers. Stuff that matters.
Re:Simple Trie Implementation in C++11 by stabbles on Sunday July 21, 2019 @04:30PM (#20493475)
Well, an unordered_map / hash map is in the end backed by a dynamically sized array, so "Map implementation don’t have to allocate space to store pointers for the entire character set" might not be true for two reasons: (1) there _is_ an additional allocation* that is not present in the std::array case for the dynamic array and (2) there is a default size of this unordered_map when nothing has been inserted yet, are you sure it's smaller than 256 elements?

* Well, maybe there is something like small vector optimization going on for small unordered_maps, though.

Re:Simple Trie Implementation in C++11 by panda88888 on Sunday July 21, 2019 @04:36PM (#20493501)
Agreed.

For the standard implementation, the dynamically allocated array may be bigger than 256. I would imagine, since it’s C++, it’s probably possible to set the initial array size.