§6B+Trees【Definition】AB+treeoforderMisatreewiththefollowingstructuralproperties:(1)Therootiseitheraleaforhasbetween2andMchildren.(2)Allnonleafnodes(excepttheroot)havebetween?M/2?andMchildren.(3)Allleavesareatthesamedepth.Assumeeachnonrootleafalsohasbetween?M/2?andMchildren.12152531415984911,4,8,1112,1315,18,1921,2425,2631,3841,43,4648,49,5059,6872,7884,8891,92B+treeoforder4(2-3-4tree)Alltheactualdataarestoredattheleaves.EachinteriornodecontainsMpointerstothechildren.AndM?1smallestkeyvaluesinthesubtreesexceptthe1stone.1/11
§6B+TreesAB+treeoforder3(2-3tree)8,11,1216,1722,23,3141,5258,59,6116:?41:5822:??Find:52?Insert:1816,17,18?Insert:1?11,1222,23,3141,5258,59,6111:1641:5822:?16,17,181,8?Insert:19?11,1222,23,3141,5258,59,6111:?41:5816:2216,171,818,1918:??Insert:282/11
§6B+Trees11,1222,2341,5258,59,6111:?58:?16:?16,171,818,1918:?28,3128:?22:?41:??Insert:70Firstfindasiblingwith2keysandadjust.Keepmorenodesfull.?Deletionissimilartoinsertionexceptthattherootisremovedwhenitlosestwochildren.3/11
§6B-TreesForageneralB-treeoforderMBtreeInsert(ElementTypeX,BtreeT){ SearchfromroottoleafforXandfindtheproperleafnode; InsertX; while(thisnodehasM+1keys){ splititinto2nodeswith?(M+1)/2?and?(M+1)/2?keys,respectively; if(thisnodeistheroot) createanewrootwithtwochildren; checkitsparent; }}Depth(M,N)=O(?log?M/2?N?)T=O(M)T(M,N)=O((M/logM)logN)TFind(M,N)=O(logN)Note:ThebestchoiceofMis3or4.Homework:p.1384.36Accessa2-3tree4/11
InvertedFileIndexHowcanIfindinwhichretrievedwebpagesthatincludeComputerScience?5/11
InvertedFileIndex?Solution1:ScaneachpageforthestringComputerScience.Waittillyournextlife!HowdidGoogledo?6/11
InvertedFileIndex?Solution2:InvertedFileIndex【Defi
您可能关注的文档
- 教程讲稿介绍windows quectelusb drivers installation guide v1.pdf
- 广东省广州市白云区竹料第一中学2025-2026学年八年级上学期10月月考道德与法治试题(含答案).docx
- 广东省广州市绿翠现代实验学校2019-2020学年八年级10月月考道德与法治试题(含答案).docx
- 广东省广州市南沙榄核第二中学2019-2020学年八年级上学期第一次月学段测试道德与法治试题(含答案).docx
- 广东省广州市南沙区实验外语学校2022-2023学年八年级上学期第一次月考道德与法治试题(含答案).docx
- 广东省广州市南沙榄核第二中学2018-2019学年八年级上学期月学段测试(一)政治试题(含答案).docx
- 广东省广州市越秀区第十六中学 2022-2023学年八年级11月月考道德与法治试题(含答案).docx
- 物理0030期末考试选择题部分.pdf
- 非药物干预措施在跌倒预防中的应用.ppt
- 面向失智老人的艺术治疗应用.ppt
原创力文档

文档评论(0)