Question: Given a sequence of numbers: 8 , 5 , 2 3 , 1 2 , 1 6 , 3 , 2 0 , insert them

Given a sequence of numbers: 8,5,23,12,16,3,20, insert them into two different data structures, a max-heap and a binary search tree (BST), in the given order.
(1) Start with an empty max-heap. Insert the numbers sequentially by calling the Max-Heap-Insert procedure.What is the resulting max-heap (in array representation) after all the numbers have been inserted? Please format your answer as a sequence of numbers separated by commas (e.g.: 1,2,3,4,5,6,7).A
What is the height of this max-heap?
A
(2) Start with an empty BST. Insert the same set of numbers in the given order by calling the Tree-Insert procedure.What is the height of the BST after all the numbers have been inserted?A
Given a sequence of numbers: 8 , 5 , 2 3 , 1 2 ,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!