heap.c
struct MinHeap *createMinHeap(int capacity) {
    struct MinHeap *minHeap = (struct MinHeap *)malloc(sizeof(struct MinHeap));
    minHeap->pos = (int *)malloc(capacity * sizeof(int));
    minHeap->size = 0;
    minHeap->capacity = capacity;
    minHeap->array = (struct MinHeapNode **)malloc(capacity * sizeof(struct MinHeapNode *));
    return minHeap;
}
// Structure to represent a min heap
Structure to represent a min heap
Structure to represent a min heap
struct MinHeap *createMinHeap(int capacity) {
    struct MinHeap *minHeap = (struct MinHeap *)malloc(sizeof(struct MinHeap));
    minHeap->pos = (int *)malloc(capacity * sizeof(int));
    minHeap->size = 0;
    minHeap->capacity = capacity;
    minHeap->array = (struct MinHeapNode **)malloc(capacity * sizeof(struct MinHeapNode *));
    return minHeap;
}
struct MinHeap * createMinHeap ( int capacity ) { struct MinHeap * minHeap = ( struct MinHeap * ) malloc ( sizeof ( struct MinHeap ) ) ; minHeap -> pos = ( int * ) malloc ( capacity * sizeof ( int ) ) ; minHeap -> size = 0 ; minHeap -> capacity = capacity ; minHeap -> array = ( struct MinHeapNode * * ) malloc ( capacity * sizeof ( struct MinHeapNode * ) ) ; return minHeap ; }
Structure to represent a min heap
Structure to represent a min heap