Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) A BST for questions 2(b)-(d). (b) The BST for question 2(e). Figure 1: An empty BST for questions 2(b), 2(c), and 2(d) on left

image text in transcribed

(a) A BST for questions 2(b)-(d). (b) The BST for question 2(e). Figure 1: An empty BST for questions 2(b), 2(c), and 2(d) on left and the BST for question 2(e) on right. 2: Binary Search Trees (BSTs) (a) Insert the following items into a BST, in the following order: [11,5, 10,21,49,35,8,46]. Show the resulting tree. [6 marks ] (b) Put the following items into the BST in Figure 1a [28,37,13,48,56, 9,50,62]. Is this always unique for a fixed array and a fixed BST? Justify your answer. [6 marks] (c) Mark all non-balanced nodes in the BST in Figure 1a. Justify your answer. [6 marks ] (d) In the BST you got in the part (b) delete the following items, in the following order: [9,50,28] (So when deleting 50, 9 is not in the tree any-more ...). Show how the BST changes in each deletion. [6 marks ] (e) Consider the AVL Tree in Figure 1b. Delete the number 11 to the tree. Note that you might need to do some rotations to preserve the AVL property. [6 marks]

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

Building The Data Warehouse

Authors: W. H. Inmon

4th Edition

0764599445, 978-0764599446

More Books

Students also viewed these Databases questions

Question

What should you do, if anything? Should you report her?

Answered: 1 week ago

Question

=+2. How much staff time will it take to implement this tactic?

Answered: 1 week ago

Question

Solve for x: 2(3x 1)2(x + 5) = 12

Answered: 1 week ago