#include using namespace std; #include "BTreeNode.h" BTree::BTree( ) : root(NULL) { } void BTree::insert(int item) { if( root==NULL ) root = new BTreeLeaf(); int newKey; BTreeNode *split = root->insert(item, newKey); if(split!=NULL) { cout << "Splitting root " << endl; BTreeInternal *newRoot = new BTreeInternal(); newRoot->child[0] = root; newRoot->child[1] = split; newRoot->marker[1] = newKey; newRoot->currChildren = 2; root = newRoot; } } void BTree::dump() { root->dump(0); }