Create heap.h
This commit is contained in:
parent
b48884a441
commit
b3b532bb14
1 changed files with 17 additions and 0 deletions
17
heap.h
Normal file
17
heap.h
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#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);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue