btree insert finished!

This commit is contained in:
YuhangQ 2021-10-25 23:15:15 +08:00
parent ab822882ba
commit b26cf470d1
2 changed files with 3 additions and 3 deletions

View File

@ -103,8 +103,8 @@ public:
page.save(); page.save();
} }
static const int m = 28; static const int m = 28;
std::string key[m+100]; std::string key[m];
int val[m+200]; int val[m+1];
int parent; int parent;
private: private:
static std::map<int, BTreeNodeUUID*> map; static std::map<int, BTreeNodeUUID*> map;

View File

@ -13,8 +13,8 @@ public:
~BTreeUUID() { delete root; }; ~BTreeUUID() { delete root; };
void insert(const char* uuid, int address); void insert(const char* uuid, int address);
void print(); void print();
void innerPrint(BTreeNodeUUID* cur);
private: private:
void innerPrint(BTreeNodeUUID* cur);
void split(std::string uuid, int address, BTreeNodeUUID* parent, BTreeNodeUUID* cur); void split(std::string uuid, int address, BTreeNodeUUID* parent, BTreeNodeUUID* cur);
void insertInternal(std::string uuid, BTreeNodeUUID* cur, BTreeNodeUUID* lLeaf, BTreeNodeUUID* rLeaf); void insertInternal(std::string uuid, BTreeNodeUUID* cur, BTreeNodeUUID* lLeaf, BTreeNodeUUID* rLeaf);
BTreeNodeUUID *root; BTreeNodeUUID *root;