Binary sort tree, also known as Binary search tree (binary search trees).
AVL tree: In computer science, AVL trees are the first to invent self-balancing binary search trees. The height of the two subtrees of any node in the AVL tree is the maximum difference of one, so it is also called a height-balanced tree. When the AVL tree does not meet the AVL tree condition after adding or deleting the node, it needs to "rotate" to reconstruct itself.
Red-black Tree: RB tree. Each node has a two-prong lookup tree with color properties. In addition to the general requirements of the binary search tree, we have added the following additional requirements for any valid red-black tree:
- The nodes are red or black.
- The root node is black.
- Each leaf node (nil node, empty node) is black.
- The two child nodes of each red node are black. (no two consecutive red nodes can be found on all paths from each leaf to the root)
- All paths from any node to each of its leaves contain the same number of black nodes.
is a red and black tree:
AVL is a strictly balanced tree, so when adding or removing nodes, depending on the situation, the number of rotations is more than the red and black trees;
Red and black is weak balance, with non-strict balance in exchange for the deletion of nodes when the rotation of the reduction;
So simply say, the number of searches is much larger than insert and delete, then select the AVL tree, if the search, insert delete the number of almost the same, you should choose the RB tree.
As you can see, the time Complexity O (log2n) of these three lookups is related to the depth of the tree, so reducing the depth of the tree naturally increases the efficiency of the search.
However, in large-scale data storage, index queries are implemented using a two-fork lookup tree, and the number of elements is very large, whichresulting in a two-fork search tree tree depth is too large, resulting in disk I/O read and write too frequently, resulting in inefficient query, then how to reduce the depth of the tree, a basic idea is: the use of multi-fork tree structure. In this way, we propose a new search tree structure--The multi-path lookup tree. Based on the inspiration of the balanced binary tree, it is natural to think of a balanced multi-path search tree structure.
B-tree: A balanced multi-path search tree (not binary). B-tree tree is B-tree, B is balanced, the meaning of balance.
B+-tree:b+ 's search and B-tree are basically the same, except that all the keywords of B + tree appear at the leaf nodes, so only the leaf nodes are reached (b-trees can be hit on non-leaf nodes). B + Tree leaf node The key word in the list is ordered, and all leaf nodes have a chain pointer pointing to the next leaf node, which makes the B + tree more efficient for range lookups than the tree of trees, such as the indexed database records, to find 10<=id<= 20, so long as through the root node search to id=10 leaf node, and as long as the leaf node based on the list of the first to find a greater than 20 on the line, compared to the B-tree in the search for each of 10 to 20 from the root node each time to improve a lot of efficiency.
B*-tree: On the basis of the B + tree, the list pointers are increased for non-leaf nodes, increasing the minimum utilization of nodes from 1/2 to 2/3.
Huffman Tree: Also known as the best trees. Corresponding to the Huffman code, its main applications in data compression, encryption and decryption and other occasions.
The above is only a common but very small part of the tree, the last drawing a picture:
Resources:
Common trees in data structures (BST two fork search tree, AVL balanced binary tree, RBT red-black tree, B-tree, + + tree, b* tree)
A brief introduction to B-tree, + + Tree and b* tree
Detailed analysis of zip compression algorithm and explanation of decompression examples
Principle and realization of jumping table skiplist
It's cold, are those trees okay?