1 / 8

Figure 12-37

Figure 12-37 (a) An unbalanced binary search tree; (b) a balanced tree after rotation; (c) a balanced tree after insertion. Figure 12-38 (a) An unbalanced binary search tree; (b) a balanced tree after a single left rotation. Figure 12-39

Download Presentation

Figure 12-37

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Figure 12-37 (a) An unbalanced binary search tree; (b) a balanced tree after rotation; (c) a balanced tree after insertion

  2. Figure 12-38 (a) An unbalanced binary search tree; (b) a balanced tree after a single left rotation

  3. Figure 12-39 Before and after a single left rotation and decreases the tree’s height

  4. Figure 12-40 (a) An unbalanced binary search tree; (b) a balanced tree after a single left rotation

  5. Figure 12-41 Before and after a single left rotation that does not affect the tree’s height Note, however, that the violation has been corrected. If T3 had had a height of h, the violation would not have been corrected. -tjr

  6. Figure 12-42 (a) Before; (b) during; and (c) after a double rotation

  7. Figure 12-43 Before and after a double rotation that decreases the tree’s height

More Related