iaie
play

, iaie . with - . . EAYI.tw/newArynee.n.ndersoni99s example : - PowerPoint PPT Presentation

r - Some history : simpler to code as binary 3- node AA - Trees Encoding : - No null pointers : Bayer 1972 : create tree node 2-3 Trees a ' Black node Sentinel node , nil , and all : Guibasa Red - black Trees - i . Red node 1978 ( a binary


  1. r - Some history : simpler to code as binary 3- node AA - Trees Encoding : - No null pointers : Bayer 1972 : create tree node 2-3 Trees a ' Black node Sentinel node , nil , and all : Guibasa Red - black Trees ⑤ - i . Red node 1978 ( a binary nulls point to it - nil → Sedgewick " ¥⑥ ⑥ : ← : Each node stores No colors variant of 23 ) ⑥ . , . level number . . - Gvibas had two Red child is Rumor level ; - ④ . as parent . E. at same level - redo black to pens . . . , iaie . with - . . EAYI.tw/newArynee.n.ndersoni99s example : / . - tree : Red - Black and AA Red - Black 2- Stree : ' ① %%Q ⑨ ⑥ oemagha.mn ? gny.odgaifgnogrise so 'iTiEEiiiThaT . . ' Eff erynodelabekdredlblaikhimma.ared.blaoktreeu.tt indie ' I ::÷:÷÷÷÷÷÷:÷i÷÷:7a .in#ic::i:::r:e::ia::...ei.ei::9e:..:. - n keys has height Ollogn ) ib;d satisfy rules is black ① Root : at most twice that Proof : ' Its as if black , ③ Nulls treated imii to 2-3-4 trees encoding r .

  2. - , € 8 Example Restructuring Ops inserts ) : : ⑦ ⑤ : Restore right skew → Level skew AAH ↳ tree : " " ' → If black node has s . . → . . . ③ - - . red left child - - - - - - ÷ ④ , rotate - - - - - - - Eis ¥ . :& - p ⑤ . I i - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - ' - . . : o n - - - n s me . , 175317954in , . . , to split :-# abiacknodenasa f- Backs ethewkaffnasye.ua " AA Insertion : s - right red chain twapgppl ? , do a left right of - ow - u on it right child g. and ← qq.dgyemindQ.it#:~m rotation what , move g 's level up by one . :÷÷ ¥ ÷÷ ¥¥ ÷ ¥ ÷ ! ,q i-AANodesplitfAANodep71.is ) you of ? . . - . . - - - . . . - . . . . - - " " Hide : YETI : : " I ④ iiiiiiiiiiiiiii : : . . " . . " out .ie:1 ? p.rightieuei==p.rignt.rightievel/ ,ieYe%pY÷tI÷%nef " ÷÷÷÷÷÷÷÷÷÷÷i ¥ :* :* " hi :km Tilsit ← all okay glebe return ( levels are monotone ) p -o TnThT . .

  3. im e - " tonight - - AANodeimsertfkeyx.lk/vev,AANodep7l Example / : a )g ④ ¥ 3 " ' eat ' ] ( ④ - ftp.nil ) left . right I ← - t , nil ) p=newAANode( x. v. 1. nil . . - Kipling - t - - - - i - - - - - - - - - ← skew - - - ' ② s . Of Of else iflxcp - key ) . . ② . . . insert on left . . ④ skew " " " " . . . . . , :÷÷ ¥ ÷÷ ¥ ÷÷÷÷ ; - " " . ' Tickets knew .ie it - ! AAtrees#mT . ' . amp ,e , ④ delete " ) - t - ii. ' - - - ④ - - - Black and ) es/ ⑥ z , . . . ' Of . . . Red ② " " Q ② ④ ' ' . ! ! . " " " " " ⑦ www..IT ? DeTetion:a%DfixAfterDeletelp ) : D ¥ ' fskew } split ④ " " ⑧ - update pi level more helpers Two → - I ④ : is . . update Level : Ifpi level . - skew ( p ) - right ) , skewlp - i I - - - n - - . - . ↳ min ( plett . right . level , exceeds b- skewlp . right ) ② ② ' - f - f - It - split Cp ) . right . ) - ft . -1 - f - right ) . level ) , split ( p . ) ' if ③ ⑤ ⑦ ⑨ ④ if p . . . . . . thensetpileucltol - alsop 's deletion : same ⑤ ⑦ ⑨ ④ as AVL deletion , but end with right child : return fixltfterteletelp ) ° ,

Recommend


More recommend