网站大量收购独家精品文档,联系QQ:2885784924

目标加速搜索随工具二进制树根大小问题尽管高度但可能一样糟糕splay treeavl张开.pptx

目标加速搜索随工具二进制树根大小问题尽管高度但可能一样糟糕splay treeavl张开.pptx

  1. 1、本文档共18页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多

§4AVLTreesTarget:Speedupsearching(withinsertionanddeletion)Tool:BinarysearchtreesrootsmalllargeProblem:AlthoughTp=O(height),buttheheightcanbeasbadasΩ(N)CHAPTER4Trees1/18

§4AVLTrees〖Example〗2binarysearchtreesobtainedforthemonthsoftheyearNovOctSeptMayMarJuneJulyDecAugAprFebJanJulyJuneMarMayOctSeptNovJanFebAugAprDecEnteredfromJantoDecAbalancedtree2/18Averagesearchtime=3.5Averagesearchtime=3.1Averagesearchtimeoftheskewtree=6.5

§4AVLTreesAdelson-Velskii-Landis(AVL)Trees(1962)【Definition】Anemptybinarytreeisheightbalanced.IfTisanonemptybinarytreewithTLandTRasitsleftandrightsubtrees,thenTisheightbalancediff(1)TLandTRareheightbalanced,and(2)|hL?hR|?1wherehLandhRaretheheightsofTLandTR,respectively.【Definition】ThebalancefactorBF(node)=hL?hR.InanAVLtree,BF(node)=?1,0,or1.582143778214354563217Theheightofanemptytreeisdefinedtobe–1.3/18

§4AVLTrees〖Example〗InputthemonthsMarMar0?1MayMay0NovNov0?1?2May0?1Nov00?2?1Mar000?ThetroublemakerNovisintherightsubtree’srightsubtreeofthetroublefinderMar.HenceitiscalledanRRrotation.Ingeneral:A?1B0BLBRALRRInsertionRRRotationA?2B?1BLBRALBLB0AALBR0AisnotnecessarilytherootofthetreeSinglerotation4/18

§4AVLTreesAugMay0?1Nov00?2?1Mar011Aug0AprApr01225/18Discussion1:Whatcanwedonow?

§4AVLTreesMay0?1Nov00?2?1Aug011?1Mar00Apr0JanJan01?12LRRotationMar0?1May0?1?2?1Aug010?1Jan00Apr0Nov0Ingeneral:A1B0BLARC0CRCLLRInsertionA2B?1BLARC?1CRCLORLRRotationBLARC0A?1or0CRB0or1CLORDoubleRotation6/18

§4AVLTreesDecJulyMar0?1May0?1?2?1Aug011?1Jan0Apr0Nov0July0Dec0FebFeb0?11?22RLRotationJuly0Dec0?1Aug01?2?1Jan010?1Feb00Apr0Mar0?1May0?1?2?11Nov0Ingeneral:A1B0BRALC0CLCRRLInsertionA?2B1BRALC?1CLCRORRLRotationBRALC0A0or1CLB?1or0CROR7/18

§4AVLTreesJuly0Dec0?1Aug01?2?1Jan010?1Feb00Apr0Mar0?1May0?1?2?11Nov0JuneOctSeptJune0?

文档评论(0)

136****1820 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档