I. Red/black tree (RB-tree)
The red/black tree is a balanced binary search tree with 'color' features on each node..
In addition to the conditions for balancing Binary Trees, it also has the following features:
1) The Node color is red or black;
2) the color of the root node is black;
3) if a node has a red attribute, its subnodes must be black;
4) All leaf nodes are black (the leaf node is null );
5) from any node to all simple paths of its leaf (null) node, contains the same number of black nodes.
The sgi stl containers based on the red and black trees include: Set, MAP, Multiset, and multimap..
II. B tree
B is a balanced multi-Cross Tree.Generally, the M-Level B tree should meet these conditions:
1) each node can have up to M subnodes;
2) Apart from root nodes and leaf nodes, each node must have at least [Ceil (M/2)] subnodes. Ceil () is the upper limit function;
3) All leaf nodes are on the same layer, and leaf nodes do not contain any keyword information;
4) Non-leaf nodes with n key codes exactly have n + 1 subnodes.
Tree B is mostly used for index Implementation of disk databases.
3. B + tree
The B + tree is a variant of the B tree and also a multi-cross search tree.. The main difference between B and B is:
1) The number of subtree pointers and keywords for non-leaf nodes is the same;
2) adjacent subtree pointers of non-leaf nodes P [I] and P [J], p [I] Point to key value V [I] ~ Between V [J-1;
3) All the keyword information to be searched is stored in the leaf node, and the linked list pointer is added between them. Non-leaf nodes are only part of the index, that is to say, only leaf nodes can be searched.
Adding a linked list pointer to the leaf node in the B + tree facilitates the fission or merging operations caused by element insertion or deletion.The B + tree is more suitable for file index systems.