- 0
- 0
- 约3.76千字
- 约 11页
- 2019-04-01 发布于湖南
- 举报
§6B+Trees
【Definition】AB+treeoforderMisatreewiththefollowingstructuralproperties:
(1)Therootiseitheraleaforhasbetween2andMchildren.
(2)Allnonleafnodes(excepttheroot)havebetweenM/2andMchildren.
(3)Allleavesareatthesamedepth.
AssumeeachnonrootleafalsohasbetweenM/2andMchildren.
AB+treeoforder4
(2-3-4tree)
Alltheactualdataarestoredattheleaves.
EachinteriornodecontainsMpointerstothechildren.
AndM1smallestkeyvaluesinthesubtreesexceptthe1stone.
1/11
§6 B+ Trees
A B+ tree of order 3
(2-3 tree)
Find: 52
Insert: 18
16,17,18
Insert: 1
Insert: 19
Insert: 28
2/11
§6 B+ Trees
Insert: 70
First find a sibling with 2 keys and adjust. Keep more nodes full.
Deletion is similar to insertion except that the root is removed when it loses two children.
3/11
§6 B-Trees
For a general B-tree of order M
Btree Insert ( ElementType X, Btree T )
{
Search from root to leaf for X and find the proper leaf node;
Insert X;
while ( this node has M+1 keys ) {
split it into 2 nodes with (M+1)/2 and (M+1)/2 keys, respectively;
if (this node is the root)
create a new root with two children;
check its parent;
}
}
Depth(M, N) =
O( logM/2 N )
T = O(M)
T(M, N) = O( (M/log M) log N )
TFind (M, N) = O( log N )
Note: The best choice of M is 3 or 4.
Home work:
p.138 4.36
Access a 2-3 tree
4/11
Inverted File Index
How can I find in which
retrieved web pages that include
Computer Science?
5/11
Inverted File Index
Solution 1: Scan each page for the string Computer Science.
How did Google do?
6/11
Inverted File Index
Solution 2: Inverted File Index
【Definition】 Index is a mechanism for locating a given term in a text.
【Definition】 Inverted file contains a list of pointers (e.g. the number of a page) to all occurrences of that term in the text.
〖Example〗 Document sets
Doc
Text
1
Gold silver truck
2
Shipment of gold damaged in a fire
3
Delivery of silver arrived in a silver truck
4
Shipment of gold arrived in a truck
您可能关注的文档
最近下载
- 医学课件-社区护理学——绪论.pptx VIP
- 2022年袋鼠数学思维Level-A (1-2年级) 真题+解析.pdf VIP
- 中国国家标准 GB/T 13761.1-2022土工合成材料 规定压力下厚度的测定 第1部分:单层产品.pdf
- (2025)全国辅警考试题库及答案.docx VIP
- 冀美版小学美术四年级下册全册教案.doc
- 设计与开发控制程序.docx VIP
- 专题26 导数及其应用解答题(八大考点,100题)(解析版)十年(2016-2025)高考数学真题分类汇编.docx
- 【建筑专业】12J502-2内装修室内吊顶(完整).pdf VIP
- 2-霍尼菲尔扫描头n5680操作手册.pdf VIP
- 大学Access数据库课件.pptx VIP
原创力文档

文档评论(0)