Search Trees_Part_8

Search Trees_Part_8 - Removal Trinode Restructuring Case 2 height =h h or h-1 z y Restructure T0 y h-3 T1 h-1 or z h-2 h-1 h-2 or h-3 h-2 x x h-2

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Removal: Trinode Restructuring - Case 2 height =h h or h-1 z y Restructure T0 y h-3 T1 h-1 or z h-2 h-1 h-2 or h-3 h-2 x x h-2 T0 h-3 T2 T3 T1 h-2 or h-3 T2 T3 h-3 or h-3 & h-4 h-3 or h-3 & h-4 CSE 2011 Prof. J. Elder - 36 - Last Updated: 3/3/10 6:14 PM Removal: Trinode Restructuring - Case 3 height =h z h or h-1 Restructure h-1 h-3 T0 y h-2 h-3 h-1 or y h-2 T3 x h-2 z x T0 T1 T2 h-3 h-3 T1 T2 T3 h-3 or h-3 & h-4 h-3 or h-3 & h-4 CSE 2011 Prof. J. Elder - 37 - Last Updated: 3/3/10 6:14 PM Removal: Trinode Restructuring - Case 4 height =h z h or h-1 Restructure T0 h-3 y h-1 x h-2 T3 h-2 x h-1 y or h-2 z h-3 T0 T1 T2 h-3 h-3 T1 T2 T3 h-3 or h-3 & h-4 h-3 or h-3 & h-4 CSE 2011 Prof. J. Elder - 38 - Last Updated: 3/3/10 6:14 PM Removal: Rebalancing Strategy Step 2: Repair Unfortunately, trinode restructuring may reduce the height of the subtree, causing another imbalance further up the tree. Thus this search and repair process must be repeated until we reach the root. CSE 2011 Prof. J. Elder - 39 - Last Updated: 3/3/10 6:14 PM Java Implementation of AVL Trees Please see text CSE 2011 Prof. J. Elder - 40 - Last Updated: 3/3/10 6:14 PM ...
View Full Document

This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Page1 / 5

Search Trees_Part_8 - Removal Trinode Restructuring Case 2 height =h h or h-1 z y Restructure T0 y h-3 T1 h-1 or z h-2 h-1 h-2 or h-3 h-2 x x h-2

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online