Question: Complete the following in python Write a program that inputs N elements. A minimum heap data structure should be created to hold the N elements

Complete the following in python
Write a program that inputs N elements. A minimum heap data structure should be
created to hold the N elements using the following two methods:
a. Elements inserted into the heap data structure one at a time
b. Use all the elements to build a heap in linear time (pass all the elements in at
once)
The input/creation process should be repeated 3 times using the following criteria:
a. the input elements should be sorted from smallest to largest
b. the input elements should be sorted from largest to smallest
c. the input elements should be randomized.
Compare the run times for each of the 6 different approaches.
If a d-heap is stored as an array, for an entry located in position i, where are the parents
and children? Be sure to note if your index starts at 0 or 1 and give examples
demonstrating the correctness of your formula.
 Complete the following in python Write a program that inputs N

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 Databases Questions!