Submit and pass all tests to enable saving to GitHub.
Implementation
Why This Matters
SQLite's file format documents exactly this node layout — keys, child pointers, and a leaf flag packed into a page — and PostgreSQL's nbtree access method follows the same shape for every index. Getting the child-count-to-key-count relationship wrong here is the same bug class that corrupts real index files and forces a REINDEX.
Hints
0 / 3 revealed
Sample validation
Sample case for Run. Submit grades this sample plus all hidden tests.
main.c
Workspace 1.0
Write a C program that defines and prints a B-tree node structure.
Requirements:
Define MAX_KEYS as 3 (for demonstration; real databases use much larger)
Define a BTreeNode struct with:
int keys[MAX_KEYS]
int values[MAX_KEYS]
struct BTreeNode* children[MAX_KEYS + 1]
int num_keys
int is_leaf
Implement create_node() that allocates and initializes a node