Daily demo of learning data structures and algorithms
Problem analysis of binary tree
2-3 of the multi-fork tree
2-3 tree construction diagram
B tree, B + tree, B * tree of multi-fork tree
Introduction to B-tree
B + tree introduction
B * tree introduction
Expansion: Why is MySQL index more suitable for B + tree?
- The B + tree is more suitable for external storage, that is, disk storage. Since the internal node has no data field, the position where each node can index is larger and more accurate
- The pointers of adjacent nodes of the B + tree can greatly increase the accessibility of the interval, which can be used in range query, etc., and the key and data of each node of the B- tree are together, and there is no pointer of the adjacent node, and the interval search cannot be performed
- Each node of the B-tree saves both data and indexes, so there is very little disk IO, and the B + tree only has leaf nodes to save data, so there are many disk IO
- As a relational database, MySQL has very strong data correlation, and interval access is a common situation.B + trees are all stored in leaf nodes and are linked together through pointers.It is easy to perform interval traversal or even all traversal.