Question: 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,

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
Get step-by-step solutions from verified subject matter experts
