heaps = an ADT-like-thingy that allows us to implement stuff like priority queues

heaps can be conceptualised as dense tree structures

heaps are often implemented as arrays (given that we know the max size)

simple index calculations allow traversal through tree:

for an item at index $i$,

generally don’t store anything at index 0 so that the above index calculations work easily

typedef struct HeapRep {
	Item *items; // array of items
	int nitems; // number of items in array
	int nslots; // number of slots in array (basically a max-size)
} HeapRep;

typedef HeapRep *Heap;