3 ms·
Heapq is a priority queue implemented on a binary tree; not a btree. > I dont say it's not a good DS, but having it in all languages stdlib seems overkill give
by fnord123 6y ago
Heapq is a priority queue implemented on a binary tree; not a btree.
> I dont say it's not a good DS, but having it in all languages stdlib seems overkill given the tool we have today.
C++ has map and Java has TreeMap. These are both red black trees (which are equivalent to btrees where k=4). So there's no question of whether there are ordered mapping types in these languages. IMO they'd be better as b(+)rees with a wider fanout. That's all.