Implement the list of instructions below on an initial empty AVL
tree. Give the parent implementation of the tree at the indicated
points. Type NULL as the parent for the root of the tree. For the
deletion, assume in-order predecessor replacement strategy, where
applicable.
1. insert P
2. insert R
3. insert O
4. insert M
5. insert U
6. insert L
7. delete P
8. insert G
9. insert A
10. insert T
11. insert E
12. insert D
13. delete E
Give the parent array representation of the tree after the sixth
instruction (6 blanks)
Parent[item] _
_ _
_ _
_
Item
P R
O M
U L
Give the parent array representation of the tree after the
seventh instruction (5 blanks)
Parent[item] _
_ _
_ _
Item
R
O M
U L
Give the parent array representation of the tree after the
twelfth instruction (10 blanks)
Parent[item] _
_ _
_ _
_
_ _
_ _
Item
R O
M U
L G
A T
E D
Give the parent array representation of the tree after the
thirteenth instruction (9 blanks)
Parent[item] _
_ _
_ _
_
_ _ _
Item
R O
M U
L G
A T D
Implement the list of instructions below on an initial empty AVL tree. Give the parent implementation of the tree at the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am