2.4 B-tree/B+tree

1. In a step 3 of example B-Tree

1. The disk space occupied by each node is a disk block, there are two pointers in ascending order of keyword and three points on a child node of the root node, the address pointer is stored in disk blocks child node is located.

2. The two keywords into three ranges corresponding to the range of the domain-domain data pointer to three subtrees.

3. In the root, for example, 17 and 35 for the keywords, the data range P1 subtree pointer is less than 17, the range of data pointer P2 subtree is 17 to 35, the data pointer P3 subtree in the range of greater than 35.


'' 'Keyword search process simulation 29:' ''
Find disk block # 1 based on the root node, read into memory. [Disk I / O operation times 1]
# 29 at keywords in the interval (17, 35), find the disk block pointer P2 1.
The pointer P2 # find disk block 3 is read into memory. [Disk I / O operations 2nd]
# 29 at keywords in the interval (26, 30), find the disk block pointer P2 3.
Found disk block # 8 P2 pointer, read into memory. [Disk I / O operation times 3]
# 29 Keyword found in the keyword list 8 disk blocks.

 

2. B + tree ( at each node can be stored and four values of pointer information an example construction)

1. B + Tree of non-leaf nodes store only the key information, assuming that each disk can store four key block and pointer information

2. On the B + Tree two head pointer, a pointer to the root node, pointing to another keyword minimum leaf node, and a ring structure is a chain among all the leaf nodes (i.e., node data).

3. Accordingly to the B + Tree can be one of two search operation: one for the primary key range search and find the tab, the other is from the root node, random search.

 1

 

Guess you like

Origin www.cnblogs.com/lihouqi/p/12664257.html