[prev] 104 [next]

2-3-4 Trees (cont)

Starting with the root node:

repeat

  • if current node is full (i.e. contains 3 items)
    • split into two 2-nodes
    • promote middle element to parent
      • if no parent ⇒ middle element becomes the new root 2-node
    • go back to parent node
  • if current node is a leaf
    • insert Item in this node, degree++
  • if current node is not a leaf
    • go to child where Item belongs
until Item inserted