Esempio n. 1
0
    void insert(int item) 
    {
      if( root==NULL ) 
         root = new BLeaf();
      int newKey;
      BTreeNode *split = root->insert(item, newKey);
      if(split!=NULL) {      
	 cout << "Splitting root " << endl;
         BInternal *newRoot = new BInternal();
         newRoot->child[0] = root;
         newRoot->child[1] = split;
         newRoot->marker[1] = newKey;
         newRoot->currChildren = 2;
         root = newRoot;
      }
    }