The idea behind B-trees is that inner nodes can have a variable number of child nodes within some pre-defined range. This causes B-trees to not need re-balancing frequently, unlike AVL trees. The lower and upper bounds on the number of child nodes are fixed for a particluar implementation. For example, in a 2-3 B-tree (often simply *2-3 tree*), each node may have only 2 or 3 child nodes. A node is considered to be in an illegal state if it has an invalid number of child nodes.

See also red-black tree.

Table of contents |

2 Steps for Deletion 3 Steps for Insertion 4 Searching 5 Notes 6 External Links |

*Generally speaking, the "separation values" can simply be the values of the tree.*

- If after removing the desired node, no inner node is in an illegal state then the process is finished.
- If some inner node is in an illegal state then there are two possible cases:
- Its sibling node (a child of the same parent node) can transfer one of its child nodes to the current node and return it to a legal state. If so, after updating the separation values in the parent and the two siblings the operation ends.
- Its sibling does not have an extra child because it is on the lower bound too. In that case both these nodes are merged into a single node and the action is transferred to the parent node, since it has had a child node removed.

- If after inserting the node into the appropriate position, no inner node is in an illegal state then the process is finished.
- If some node has more than the maximum amount of child nodes then it is split into two nodes, each with the minimum amount of child nodes. This process continues action recursivly in the parent node.

Searching is performed very similar to a binary tree search, simply by following the separation values until the value is found or the end of the tree is reached.

Robert Tarjan proved that the amortized number of splits/merges is 2.