-
main.cpp:
Contains themain()function and the user interaction loop. It handles user commands, calls corresponding B-Tree operations, and manages file opening and closing. -
Btree.cpp:
Implements theBTreeclass and all its related operations:- Creating and opening index files.
- Inserting keys and values.
- Searching for keys.
- Loading keys/values from a CSV file.
- Printing keys/values in ascending order.
- Extracting keys/values to a file.
It includes logic for reading/writing nodes to disk, maintaining the header block, and ensuring keys are stored in big-endian format.
-
writeIndex.cpp:
Provides functions for converting between host-endian and big-endian formats. These ensure correct byte ordering when reading and writing integers to the index file.
Make sure all three files (main.cpp, Btree.cpp, and writeIndex.cpp) are in the same directory.
Compile using:
g++ main.cpp -o btree_program