+ uint left, right;
+ Clave *kout = AddKeyR (&k, 0, left, right);
+
+ if (kout) {
+ unsigned short level;
+ /* Debo dejar la raiz en el nodo 0, por lo que paso el nodo
+ * que esta usando el hijo izquierdo a un nuevo nodo */
+ std::list<BTreeData *> node_keys;
+ BTreeNodeHeader node_header;
+ uchar *node = ReadBlock (left);
+ ReadNodoHeader (node, &node_header);
+ node_keys = ReadKeys (node, node_header);
+ level = node_header.level + 1;
+
+ uchar *new_node = NewBlock (left);
+ delete [] new_node; /* No me interesa, voy a usar lo leio antes */
+
+ WriteKeys (node, node_header, node_keys);
+ WriteNodoHeader (node, &node_header);
+ WriteBlock (node, left);
+ delete [] node;
+
+ /* Leo y actualizo la Raiz */
+ node = ReadBlock (0);
+ ReadNodoHeader (node, &node_header);
+ node_keys = std::list<BTreeData *>();
+
+ node_keys.push_back (new BTreeChildData (left));
+ node_keys.push_back (new BTreeData (kout, right));
+
+ node_header.level = level;
+ node_header.item_count = 1;
+
+ WriteKeys (node, node_header, node_keys);
+ WriteNodoHeader (node, &node_header);
+ WriteBlock (node, 0);
+ PrintNode (0);
+ }
+}
+
+Clave* BTree::AddKeyR (const Clave *k, uint node_num, uint &left_child, uint &right_child)
+{
+ Clave *kout = NULL;
+ std::list<BTreeData *> node_keys;
+
+ BTreeData *data = new BTreeLeafData (k->Clone ());