An implentation of a heap in c