[prev] 25 [next]

Insertion into B-Trees

Overview of the method:

  1. find leaf node and position in node where entry would be stored
  2. if node is not full, insert entry into appropriate spot
  3. if node is full, split node into two half-full nodes
                           and promote middle element to parent
  4. if parent full, split and promote upwards
  5. if reach root, and root is full, make new root upwards


Note: if duplicates not allowed and key exists, may stop after step 1.