Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Suppose you want to create a binary tree with the following numbers [1, 225, 4, 196, 9, 169, 16, 144, 25, 121, 36, 100, 49,

image text in transcribed

Suppose you want to create a binary tree with the following numbers [1, 225, 4, 196, 9, 169, 16, 144, 25, 121, 36, 100, 49, 81, 64] Insert the numbers, in the order given, into a binary search tree (do not perform any balancing) (2 pts) Insert the numbers, in the order given, into an AVL tree (2 pts) Insert the numbers all at once with the following procedure: (2 pts) i. a. b. c. Sort the list into ascending order ii. Find the median element and make it the root of the tree (if it's even length, choose the left median) By taking the median out of the list, you are left with a left and right sublist. Find the median of each of those and make them respectively the left and right children of the root. Repeat this until the whole list is in the tree iii. iv. Which method produced the most balanced tree? (1 pt) What are the benefits and weaknesses of the AVL tree vs using the procedure outlined in part c? (2 pts) d. e

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions