News for hackers. Stuff that matters.
Re:Intrusive lists in Doom 3 by nly on Thursday December 25, 2014 @05:47AM (#8795995)
std::map is implemented using a tree and not a hash table because it's specified as an ordered data structure.
Re:Intrusive lists in Doom 3 by sorbits on Thursday December 25, 2014 @07:51AM (#8796155)
I am quite sure (based on interviews I’ve read) that Alexander Stepanov’s primary concern was having a data structure with known (fixed) complexity rather than a sorted container. The latter is just a nice side-effect.
Re:Intrusive lists in Doom 3 by dfkf on Thursday December 25, 2014 @12:48PM (#8796728)
In the worst case scenario the time complexity of a hash table equals that of its bucket, which doesn't have to be a list. So the only advantage of the map over the unordered_map seems to be the ease of use, it only needs a comparer.
Re:Intrusive lists in Doom 3 by nly on Thursday December 25, 2014 @01:36PM (#8796831)
unordered_map pretty much has to have linked buckets due to its interface and complexity requirements.