B-Tree | Set 2 (Insert) In the previous post , we introduced B-Tree. We also discussed search() and traverse() functions. In this post, insert() operation is discussed. A new key is always inserted at leaf node. Let the key to be inserted be k. Like BST, we start from root and traverse down till we reach a leaf node. Once we reach a leaf node, we insert the key in that leaf node. Unlike BSTs, we have a predefined range on number of keys that a node can contain. So before inserting a key to node, we make sure that the node has extra space.
Read full article from B-Tree | Set 2 (Insert) | GeeksforGeeks