the.com/heap
A pile pretending to be organized: the root always wins, siblings don't compete.
means A collection of things piled or gathered together, often messily, into one undifferentiated mass.
from Heap traces back to Old English 'heap,' meaning a pile or crowd, with relatives in other Germanic languages like Old Saxon 'hop' and German 'Haufe' (still used today for a pile or heap). The deeper root is believed to connect to an ancient Germanic base tied to bending or curving — the idea of things gathered into a mounded, bulging shape rather than laid out flat. It's been doing steady, humble work in English for over a thousand years, describing everything from junk piles to crowds of people ('a heap of trouble').
- shape rule
- parent always beats children, that's it
- not sorted
- only top element is guaranteed correct
- used for
- priority queues, heapsort, Dijkstra's algorithm
- build time
- builds from array in linear time, not n log n