2-3-delete-middle-node Algorithm

The numbers mean a tree where every node with children (internal node) has either two, three, or four child nodes: a 2-node has one data component, and if internal has two child nodes; a 3-node has two data components, and if internal has three child nodes; a 4-node has three data components, and if internal has four child nodes; 2–3–4 trees are B-trees of order 4; like B-trees in general, they can search, insert and delete in O(log N) time. In other words, for every 2–3–4 tree, there exists at least one red – black tree with data components in the same order.

2-3-delete-middle-node source code, pseudocode and analysis