heap push
This commit is contained in:
parent
7916f181c5
commit
83061c4658
2 changed files with 26 additions and 11 deletions
6
heap.h
6
heap.h
|
|
@ -1,13 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "record.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
typedef struct {
|
||||
record* location;
|
||||
int g;
|
||||
int index;
|
||||
int buffer_id;
|
||||
bool is_blank;
|
||||
} heap_record;
|
||||
|
||||
// almost the same as typedef buffer, but the usage is different, so I think it can be repeated
|
||||
|
|
@ -15,6 +12,7 @@ typedef struct {
|
|||
heap_record* location;
|
||||
int length;
|
||||
int capacity;
|
||||
int (*compare)(const void* a, const void* b);
|
||||
} heap;
|
||||
|
||||
heap new_heap(int size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue