Consider the following sequence of 14 operations on an initially empty search tree: 1. Insert Bob  2. Insert Tim  3. Insert Fred  4. Insert Peter  5. Insert Jane  6. Remove Tim 7. Insert Laura  8. Insert Nancy  9. Insert Hank  10. Remove Peter  11. Insert Rhea  12. Insert David  13. Remove Rhea 14. Remove Nancy   The above sequence of operations is to be performed in the exact manner into each of the following trees - BST AVL Tree 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. There should be a total of 3 diagrams per tree - finish one tree fully before starting on a different tree. Draw and sequence your diagrams clearly. If you need to make any assumptions or encounter any limitations, state them clearly.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Consider the following sequence of 14 operations on an initially empty search tree:


1. Insert Bob 
2. Insert Tim 
3. Insert Fred 
4. Insert Peter 
5. Insert Jane 
6. Remove Tim
7. Insert Laura 
8. Insert Nancy 
9. Insert Hank 
10. Remove Peter 
11. Insert Rhea 
12. Insert David 
13. Remove Rhea
14. Remove Nancy

 

  1. The above sequence of operations is to be performed in the exact manner into each of the following trees -
    • BST
    • AVL Tree
    • 2-3 Tree
    • Max Heap
  2. 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)
  3. 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.
  4. 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.
  5. There should be a total of 3 diagrams per tree - finish one tree fully before starting on a different tree. Draw and sequence your diagrams clearly.
  6. If you need to make any assumptions or encounter any limitations, state them clearly.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 12 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY