The shy heap: priority queues in linear time, if you promise not to peek

Comparison-based priority queues cost logarithmic time per operation, and that is not an engineering shortfall, it is a theorem. Feed n items into any exact heap and pop them all: the pops come out sorted, so the operations together must pay the Ω(n log n) that comparison sorting costs. If you want to go faster, you must give something up. The famous way to do that is Chazelle’s soft heap , which…