Multi-way Trees

A m-way search tree is a tree in which

- The nodes hold between 1 to m-1 distinct keys
- The keys in each node are sorted
- A node with k values has k+1 subtrees, where the subtrees may be empty.
- The i’th subtree of a node [v
_{1}, ..., v_{k}], 0__<__i__<__k, may hold only values v in the range v_{i}__<__v__<__v_{i+1}(v_{0}is assumed to equal -, and v_{k+1}is assumed to equal infty).

A m-way tree of height h has between h and m^{h} - 1 keys.

- Search the key going down the tree until reaching an empty subtree
- Insert the key to the parent of the empty subtree, if there is room in the node.
insert 8 - Insert the key to the subtree, if there is no room in its parent.
insert 27

- If the key to be deleted is between two empty subtrees, delete it
delete 8 - If the key is adjacent to a nonempty subtree, replace it with the largest key from the left subtree or the smallest key
from the right subtree
remove 16