Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following sequence of 1 6 operations on an initially empty search tree: Insert Bob Insert Tim Insert Fred Insert Peter Insert Jane Insert

Consider the following sequence of 16 operations on an initially empty search tree:
Insert Bob
Insert Tim
Insert Fred
Insert Peter
Insert Jane
Insert Willow
Remove Tim
Insert Laura
Insert Nancy
Insert Hank
Insert Samson
Remove Peter
Insert Rhea
Insert David
Remove Rhea
Remove Nancy
The above sequence of operations is to be performed in the same exact manner into each
of the following trees -
BST
AVLTree
2-3 Tree
Max Heap
Draw how each tree is structured at the following 3 steps:
After 'Remove Tim' step (step 6)
After 'Remove Peter' step (step 10)
After 'Remove Nancy' step (step 14)
For the insertion steps - follow the 'smaller node to the left subtree / greater or equal
node to the right subtree' algorithm, except for the heap where you should follow the
conventional method for inserting nodes into a heap.
For the removal steps - follow the 'in-order successor replacement' algorithm, except for
the heap where you should follow the conventional method for removing nodes from a
heap or sub-heap.
There should be a total of 3 diagrams per tree - do not include any intermediate
diagrams.
Try to finish one tree fully before starting on a different tree, otherwise you may have
confusion and errors.
Draw and sequence your diagrams clearly - if I can't understand them then you lose
points.
If you need to make any assumptions or encounter any limitations, state them clearly.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 22nd International Conference Dexa 2011 Toulouse France August/September 2011 Proceedings Part 1 Lncs 6860

Authors: Abdelkader Hameurlain ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2011th Edition

3642230873, 978-3642230875

More Books

Students also viewed these Databases questions