Skip to content
Snippets Groups Projects
bptree.h 548 B
#ifndef BPTREE_H
#define BPTREE_H

#include <stdbool.h>
#include <stdint.h>

#include "Array.h"

typedef struct BPTreeNode {
    int order;
    bool is_leaf;
    IntegerArray *keys;
    IntegerArray *data;
    BPTreeNodeArray *children;
} BPTreeNode;

BPTreeNode *bptree_init(int order);
void bptree_destroy(BPTreeNode **root);

void bptree_print(BPTreeNode *root, int depth);
bool bptree_search(BPTreeNode *root, uint64_t key, uint64_t *data);

// Insertion

void bptree_insert(BPTreeNode *root, uint64_t key, uint64_t data);

// Deletion

#endif