COP3502_32_AVLTrees2

# COP3502_32_AVLTrees2 - AVL Trees Deletion Computer Science...

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

Computer Science Department University of Central Florida AVL Trees: Deletion COP 3502 – Computer Science I

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

View Full Document
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?
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

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

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

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online