iwi
play

iwi Final Focus : Worst-case ' or randomized expected - PowerPoint PPT Presentation

' -- T .-nys-n- Recap / Other Better criteria ? Lots of search trees / : Different combinations Lesson : : Some keys - unbalanced BSI of rotations Expected case can : - bring given node to root more popular than others - AVL Trees -


  1. ' -- T .-nys-n- ⇐ Recap / Other Better criteria ? Lots of search trees / : Different combinations Lesson : : Some keys - unbalanced BSI of rotations Expected case can : - bring given node to root more popular than others - AVL Trees - significantly - adjusting ,+ghua geelimprovi ) : Tree adapts 2- 3. Red - black ,AA Trees self - - Treapsrskip lists as popularity changes iwi Final → Focus : Worst-case ¥⑤ ' ④ or randomized expected Howtodesignlanalyze ? ⑤ - ④ Splay Tree case ← : A self - adjusting - qgpumyyyt.gg ⑨ ⑤ ④ binary search tree Tree 's height has reduced ( yay anarchy ! ) - No rules ! , - half ! - No balance factors by ..÷ ¥ ÷÷÷ ¥ ÷÷÷ ¥ ÷is÷ .ir ? :t:t:i:ii:n : ' decisis :c :# ' O' ' icings 's :I:% ¥ i' cinema . ④ - . ④ Intuition : an unbalanced Lett be ④ - BSTtsupposez.ee access its deepest key ⑤ L Idea II. Rotate 2. at " final result : ⑨ -, ⑨ - upper + lower § & T atijme " + find ( " " ) ④ ④ a Q - ① d ? ugh ! ② still balanced ! → Tree restructures itself ⇒ g. ° ,

  2. - , " e : zigziglpf-lucase-A-spl.gg#egiDj.indu,cneares+node insesrptfax :÷÷÷÷÷il :* :* .in/ei:i:::i::ni while ( ptroot ) I g. new Nodelx ) child of root ) ziglp ) . Keys x ) if ( p if ( root let :* :* :÷÷÷÷÷÷ :* :* move up ? it i- ⑤ _ b Subtrees A. C' ④ ZiaZAaCp ) . " ④ I "yY ¥ {IplaytreesIm , CLR case ] ④ - : , ① Q p : ÷÷÷ . ÷÷ ¥¥ ÷÷÷÷÷÷÷÷÷÷ :÷÷÷÷÷÷÷÷ ¥ ÷÷÷ : 100 ④ LL Zig -21g 010 L -21g p : - - - - - - . . . . . . . . . . . , Eofpmovejpl ' " " Subtrees C ' " ED Finals I . . . . . . . ° ,

  3. ÷÷÷E dektsepkafixscxnwai.TO/D%e7:::m:e:Ihew:repmeitormp-- - , ' wximordersuuessorfag.gg ? .jgYteffaiskesisgxietsuc.:ens root accesses Xi . ,Xim > Xia , . . . error ! , - ij Let Dj=ij ftp.keytx ) : distance . , 's right subtree / nullbeicausey splay G) in p between consecutive items in :÷ ¥ ÷Yeim → root . I i-Y-EE.im/gBs ④ Ana ! - - anygyengpmighttakeEFYTR.eu#wM static optimality " minted analysis - : assessed I ¥ hPPp%5kp ? - Information Theory : a long sequence , average Best possible binary search - Over .at ? zsaiseigb-ased/.AmazingbAdaptive ! -exPggtedgti time is Ollogn ) each tree answers queries in Splay Trees are ;;g% .lt ? Enh.erg Amoorntitaesdopqni - - . Balance Theorem : Starting oenm.tieaydstoreduu.tw/heraeYfnY. ! nme7tenft:sesna# " static optimality Theorem : potential argument 8ifmimheg.pitgtgalypt.ge ) . on splay - potential : A function of the with an empty dictionary , . of mops Given aseg ' structure tree with keys x. " xn , where any sequence of m accesses trees Balanced ⇒ Low potential takes total tin 're . Let xiisaccessedqitmies Unbalanced ⇒ High potential ' - Every _eyyTiT . .

Recommend


More recommend