C implementation of a Heap