This commit is contained in:
2026-05-12 11:25:37 -05:00
parent 77434a4c01
commit dc4d588675
3 changed files with 651 additions and 1 deletions

23
lib/heap.c Normal file
View File

@@ -0,0 +1,23 @@
#include "stack.c"
#include <stdlib.h>
#include "khash.h"
typedef struct {
} HeapValue;
KHASH_MAP_INIT_INT(heap, HeapValue)
typedef struct {
khash_t(heap) *items;
} Heap;
static void heap_init(Heap* h)
{
h->items = kh_init(heap);
}
static void heap_finalize(Heap* h)
{
kh_destroy(heap, h->items);
}