private SplitResult splitNode(BTreeNode node,int data, BTreeNode nr1, BTreeNode nr2){
        int c = node.keys[node.n/2];
        BTreeNode r1 = BTreeNode.newNode();
        BTreeNode r2 = BTreeNode.newNode();
        r1.n = node.n/2;
        r2.n = node.n - node.n/2-1;
        if(!node.isLeaf){
            r1.isLeaf = false;
            r2.isLeaf = false;
        }
        int i=0;
        for(; i < node.n/2; i++){
            r1.keys[i] = node.keys[i];
            r1.child[i] = node.child[i];
        }
        r1.child[i] = node.child[i];
        i = node.n/2 + 1;
        int j=0;
        for(;i < node.n; i++,j++){
            r2.keys[j] = node.keys[i];
            r2.child[j] = node.child[i];
        }
        r2.child[j] = node.child[i];
        if(data < c){
            r1.insertKey(data, nr1, nr2);
        }else{
            r2.insertKey(data, nr1, nr2);
        }
        SplitResult sr = new SplitResult();
        sr.c = c;
        sr.r1 = r1;
        sr.r2 = r2;
        return sr;
    }
http://www.geeksforgeeks.org/b-tree-set-1-insert-2/
http://www.geeksforgeeks.org/b-tree-set-1-introduction-2/
src/com/interview/tree/BTree.java