Question

10 L 1 22 Given the function below, that divides the original array in two arrays of half size, develop the Java code that co
5. raw the binary min heap represented by the following array: (2 points) b) Show the result of ca deleteMin and circle the f
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Binary  Min Heap:

Step 1: Insert keys 7 & 8        

7 8

Step 2: Insert key 9          

7 89                 

Step 3: Insert key 12

9 7 8

Step 4: Insert key 13

7 8 9 12) (13

Which is Required Binary  Min Heap

b) Delete Minimum (i.e 7 )

8 12 13

Delete Minimum (i.e 8 )

12) (13

c) Insert key 4:

4 13 9 12

Insert key 3:

4 13 12) 9

Which is Required Binary  Min Heap

Add a comment
Answer #2

a) Binary  Min Heap:

Step 1: Insert keys 7 & 8        

7 8

Step 2: Insert key 9          

7 89                 

Step 3: Insert key 12

9 7 8

Step 4: Insert key 13

7 8 9 12) (13

Which is Required Binary  Min Heap

b) Delete Minimum (i.e 7 )

8 12 13

Delete Minimum (i.e 8 )

12) (13

c) Insert key 4:

4 13 9 12

Insert key 3:

4 13 12) 9

Which is Required Binary  Min Heap

Add a comment
Know the answer?
Add Answer to:
10 L 1 22 Given the function below, that divides the original array in two arrays...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1- Complete all the blanks in the function f1() below such that it implements the operations...

    1- Complete all the blanks in the function f1() below such that it implements the operations described in the comments. You may only fill in the blanks and not add or alter other code. Also complete main(). // f1 copies the last *half* of vec's values into a new array pointed to 'arr'. // 'arr' is garbage coming in and must be modified by this function so the // caller can then use the produced array. The values copied from...

  • Need this in C Code is given below e Dots l lah dit Problem 1. (30...

    Need this in C Code is given below e Dots l lah dit Problem 1. (30 points) Fre bendord.cto obtain the free in decimal representation For ATY. this problem we complete the code in i tive long inte ens (W written the following positive long term 123, 40, 56, 7, 8, 9, 90, 900 the frequencies of all the digits are: 0:4, 1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7: 1. 8: 1.9: 3 In this example, the free ency of...

  • Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In...

    Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In this project, we combine the concepts of Recursion and Merge Sorting. Please note that the focus of this project is on Merging and don't forget the following constraint: Programming Steps: 1) Create a class called Art that implements Comparable interface. 2) Read part of the file and use Merge Sort to sort the array of Art and then write them to a file. 3)...

  • Lab 6 Instructions Objectives: • Executing and experimenting with programs that handle array related topics such...

    Lab 6 Instructions Objectives: • Executing and experimenting with programs that handle array related topics such as declaration, initialization, storing, retrieving, and processing elements. • Effectively manipulating and using ArrayList objects. • Becoming familiar with the use of arrays as method arguments and how array elements are passed to and returned from the called method. • Mastering the use of various debugging tools available on the Eclipse IDU. Important: EVERY one of the following Activities MUST be in a separate...

  • Write a module of utility functions called util.py for manipulating 2-dimensional arrays of size 4x4. (These...

    Write a module of utility functions called util.py for manipulating 2-dimensional arrays of size 4x4. (These functions will be used in Question 3.) The functions you need to write are as follows: def create_grid(grid): """create a 4x4 array of zeroes within grid""" def print_grid (grid): """print out a 4x4 grid in 5-width columns within a box""" def check_lost (grid): """return True if there are no 0 values and there are no adjacent values that are equal; otherwise False""" def check_won...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT