Implementation of a max heap in C