COP3502_32_AVLTrees2 - AVL Trees Deletion Computer Science...

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

View Full Document Right Arrow Icon
Computer Science Department University of Central Florida AVL Trees: Deletion COP 3502 – Computer Science I
Background image of page 1

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

View Full DocumentRight Arrow Icon
AVL Trees: Deletion page 2 Insertion Revisited AVL Trees: Insertion Let’s take another look at insertion into AVL Trees Hopefully this will be a bit easier than previous slides Assuming you only have two nodes in your tree, what are the two possible trees you may have?
Background image of page 2
AVL Trees: Deletion page 3 Insertion Revisited AVL Trees: Insertion Given these two trees, if we want to create an imbalance, where must we insert? Clearly, we must insert at the lower of the 2 nodes This will create a scenario where the left subtree has a height that is 2 greater than the right subtree Or the opposite for the other tree depicted Now, from these two trees, draw all FOUR possible trees that can be created by inserting a new node
Background image of page 3

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

View Full DocumentRight Arrow Icon
AVL Trees: Deletion page 4 Insertion Revisited AVL Trees: Insertion Here are all four unbalanced trees that we can make from three nodes:
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

COP3502_32_AVLTrees2 - AVL Trees Deletion Computer Science...

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