- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
definition B+ tree of order m 由兩個level所組成: Index level 及Data level 所組成 所有Data均存在於Data Blocks on Data Level, Data Blocks之間以Link list串連 Index Block主要是依據key,配合索引,找到對應的Data Block 而Index Block及Data Block中的Degree數必須符合B tree of order m的規定B+ Tree (balanced Tree):所有樹葉到樹根的距離都相同 每個節點有 +m/2T~ m個子女(樹根除外) 所有樹葉都在同一層(樹根到樹葉的深度皆相同) 具有n個子女非樹葉節點有n-1個鍵 可以support ISAM (Index Sequential Access Method),主要用在external search,SORT上 例: B 與 B+ tree 的比較 B+_tree在定義上與B_tree不同,圖2畫出一個B+_Tree的例子,在B+_Tree中,只有葉節點的索引記錄才含有資料指標,其餘的節點中僅含有單純的索引值,請注意圖1中B_tree的情況是與此不同的。 為何要有B+_Tree呢? 由於B+_Tree的內節點(Internal node)不含資料指標,每個節點能存放的索引數目會比較多,相對地樹狀結構的層級數目就少一點,減少了資料方塊存取的數目,所以在實際的應用上,仍以B+_Tree較為多見。 Creat a B+ tree 插入的順序為 : 9, 6, 1, 8, 4, 13, 10, 7 Insert a key Insert a key into a leaf which still has some room (not overflow). Put the keys of this leaf in order. No changes are made in the index level. If a key is inserted into a full leaf (overflow) Split, the new leaf node is included in the sequence set, keys are distributed evenly between the old and the new leaves, and the first key from the new node is copied (not moved, as in B-tree) Delete a key Delete a key from a leaf leading to no underflow Delete the leaf and keep remaining keys in order index level 可刪可不刪 Delete a key from a leaf causes an underflow Rotation or Combination EX: B+ Tree of order 3. p*. * B+ Tree 6 , 9 7, 8 1, 4 10,13 8 6, 7 1, 4 9 8 10,13 6 9 , 10 圖2 圖1 6, 9 1 6 6, 9 1 6 , 8 6 8, 9 1, 4 6 , 8 6 8, 9 8 6 1, 4 9,13 8 6 9 8 6, 7 1, 4 9 8 10,13 6 9 , 10 8 6 1, 4 9 8 10,13 6 9 , 10 1 6 6, 9 1, 4 6 6, 9 insert 4 1, 4 6 6, 9 1, 4 6, 9 6 The parent is not full The parent is full Insert 10 9,10 Insert 3 1 3 6 9,10 3, 4 6 6, 9 delete 4 1, 4 6, 9 6 9,10 1 6, 9 6 9,10 delete 9 1, 4 6, 10 6 10 1, 4 6, 9 6 10 1 3 6 3, 4 6 6, 9 9,10 delete 1 4 6 4 6 6, 9 9,10 3 delete 6 1 3, 4 6, 9 9,10 (a) Initial tree 60 80 20 , 40 20 5,10 60 40,50 80,100 Index level Data level 60 20 , 40
文档评论(0)