Multi-way Trees

Reducing height by increasing width

Nathan Tenney

WSU Tricities

Multi-way trees

M-ary trees

M-ary trees

image

B-Trees

B-Trees

B-Trees

B-Trees

image

Worst case

let q be the minimum number of children a node can have ()

Worst case

Worst case

Insertion

  1. A key is placed in a leaf that still has some room
  2. If the leaf the key should be placed in is full, the leaf is split to create a new leaf. Half of the keys in the full leaf are moved to the new leaf, and the middle key is moved to the parent. If necessary this procedure is repeated to the root
    • Guarantees that each leaf never has less than keys
  3. if the root is full, a new root needs to be created, along with a new sibling to the current root.

Insertion

image

Insertion

image

Deletion

Deletion from a leaf

Underflow Condition

Underflow Condition

Delete from a non-leaf

Deletion from B-Tree

image

B-Tree sparseness

image

B*-Trees

B*-Tree insertion

image

General Multi-way Tree Implementation

General Multi-way Tree Implementation