file_sorting/heap.h
2025-10-21 23:35:07 +02:00

17 lines
414 B
C

#pragma once
#include "record.h"
typedef struct {
record* location;
int g;
int buffer_id;
bool is_blank;
} heap_record;
// moves elements to maintain heap property
int heapify(heap_record* heap);
// returns the first element, and calls heapify
int heap_pop(heap_record* heap, heap_record* out);
// writes to the last elements, and calls heapify
int heap_pus(heap_record* heap, heap_record* in);