Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

AVL Tree Example: Verification and Manipulation, Exercises of Advanced Algorithms

An avl tree example with verification of height balance property and insertion and deletion sequences. The tree is shown after each operation, ensuring avl property is maintained.

Typology: Exercises

2011/2012

Uploaded on 07/17/2012

padmaghira
padmaghira 🇮🇳

3.2

(5)

55 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
An AVL tree example
Consider the tree Tgiven below.
1. Verify that Tis an AVL tree (i.e. that it satisfies the so-called height
balance property).
2. For each of the sequences of inputs below, begin with the tree Tand insert
the items in the order given. Show each tree after you insert an item. Each
of these intermediate trees should also be AVL trees.
For each sequence, start over again with the original tree T.
(a) 15,12,50,49
(b) 15,50,29,12
(c) 12,15,20,60
(d) 60,12,20,15
3. Do the same as above, but instead delete the vertices as shown in the order
given. Again, any intermediate trees should also be AVL trees.
(a) 10
(b) 27,41
1
docsity.com

Partial preview of the text

Download AVL Tree Example: Verification and Manipulation and more Exercises Advanced Algorithms in PDF only on Docsity!

An AVL tree example Consider the tree T given below.

  1. Verify that T is an AVL tree (i.e. that it satisfies the so-called height balance property).
  2. For each of the sequences of inputs below, begin with the tree T and insert the items in the order given. Show each tree after you insert an item. Each of these intermediate trees should also be AVL trees. For each sequence, start over again with the original tree T. (a) 15, 12 , 50 , 49 (b) 15, 50 , 29 , 12 (c) 12, 15 , 20 , 60 (d) 60, 12 , 20 , 15
  3. Do the same as above, but instead delete the vertices as shown in the order given. Again, any intermediate trees should also be AVL trees. (a) 10 (b) 27, 41

docsity.com