1-Relational Database/1-Relational DB Concepts/B-Tree & B+ Tree/java/BTreeBase.java
/**
     * Inserts the given key-record mapping to the B-tree.
     * @param key key to insert
     * @param recordAddress record address with the key
     */
Inserts the given key-record mapping to the B-tree.
@param key key to insert
@param recordAddress record address with the key
Inserts the given key - record mapping to the B - tree . @param key key to insert @param recordAddress record address with the key
public void insert(int key, String recordAddress) {
        if (root == null) {
            root = new Node(ORDER, new IndexEntry[]{new IndexEntry(key, recordAddress)}, new Node[0]);
            return;
        }
        insertHelper(root, key, recordAddress, new Stack<>(), new Stack<>());
    }
public void insert ( int key , String recordAddress ) { if ( root == null ) { root = new Node ( ORDER , new IndexEntry [ ] { new IndexEntry ( key , recordAddress ) } , new Node [ 0 ] ) ; return ; } insertHelper ( root , key , recordAddress , new Stack < > ( ) , new Stack < > ( ) ) ; }
Inserts the given key-record mapping to the B-tree.
Inserts the given key - record mapping to the B - tree .