Question

1. Show what a heap would look like if the following values are inserted one at...

1. Show what a heap would look like if the following values are inserted one at a time versus using a bulk insert process.
Values: 10, 12, 1, 14, 6, 5, 8, 15, 3, 9, 7, 4, 11, 13, 2

2. Perform deleteMin 4 times on the heap from #1 that was inserted one at a time. Show what the heap looks like after each delete.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1. Show what a heap would look like if the following values are inserted one at...
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
  • How would the Java Program look like if I wanted to place the following values in...

    How would the Java Program look like if I wanted to place the following values in the oder that they would be in after being bulk insterted into a heap for Heap sort and how would the heap look like after three deleteMin() commands? These would be some example values: 9 5 8 2 4 3 1 7 6 0. ( place values that were removed using a delete min at the start in order that they were removed/

  • Question 3. a. Draw the binary min heap represented by the following array: (5 points) 1...

    Question 3. a. Draw the binary min heap represented by the following array: (5 points) 1 2 4 6 7 Value 4 9 12 29 17 14 16 b. Show the result of calling deleteMin twice on the heap you drew in part (a). Show the heap after each deleteMin, and circle the final heap. (5 points) c. Starting with the heap you ended up with in part (b), insert values 11 & 2 in that order. Draw the heap...

  • (e) Consider an initially empty max-heap, where the following keys are to be inserted one at...

    (e) Consider an initially empty max-heap, where the following keys are to be inserted one at a time: 11, 19, 23, 12, 13, 17, 13, 14, 18, and 33. Draw the tree that results after building this max-heap. (f) Is it possible to find the maximum in a min-heap in O(log n) time? Justify. Important Notes: • For part (e) of this problem, you must draw the min (or max) heaps using the appropriate graphics tools at your convenience.

  • [12] 3. a) Draw the binary min-heap after inserting the following values, one after another. 21,...

    [12] 3. a) Draw the binary min-heap after inserting the following values, one after another. 21, 13, 12, 25, 4, 20, 16, 1, 11 You must show each step of building the heap and eventually the final tree. Please, put your final tree inside a box so that it can be easily understood among other intermediate trees. b) A 4-ary max heap is like a binary max heap, but instead of 2 children, nodes have 4 children. A 4-ary heap...

  • given the following key values, show what the data structures would look like after insertions: Hashing...

    given the following key values, show what the data structures would look like after insertions: Hashing Lab Given the following key values, show what the data structures would look like after insertions 27 53 13 10 138 109 49 174 26 24 (no preprocessing necessary: PL = key) a. Linear array of 10 elements using division hashing b. Bucket hashing of 10 elements (N=10) and the linear-quotient collision path algorithm ip = (p) % N N = 13, 4k+3 prime...

  • c++ *construct (draw) a Max Heap when the following keys are inserted in the given order:...

    c++ *construct (draw) a Max Heap when the following keys are inserted in the given order: 5, 10, 4, 3, 1, 15, 11, 12, 20, 19, 2 *What is the index of the right child of key 20? *Draw the max Heap after performing removeMax()

  • 10 L 1 22 Given the function below, that divides the original array in two arrays...

    10 L 1 22 Given the function below, that divides the original array in two arrays of half size, develop the Java code that combines two sorted arrays or clearly explain how to implement the merge function. (3 points) nt middle values.Length/2; // divide array into two arrays of half size nt left- new int[middle]; or Cint i-e; imiddle; i+) t Leftri] - values[iJ: ntD right- new int[values. length-middle]: or Cint i-a; i<values.length-middle; i++) t rightli] -values [middle+i]; ort(left); //recursively...

  • Consider the following values for the following questions: 87, 11, 34, 45, 123, 34, 66, 107...

    Consider the following values for the following questions: 87, 11, 34, 45, 123, 34, 66, 107 10. What are the two constraints for a binary tree to be a MaxHeap tree? 11. Construct a max heap tree with all the values. List all steps. 12. Insert 99 to the above tree. List all steps. 13. Perform delete operation, what value does it give? 14. After the above delete operation, how does the tree change? List all steps Consider the following...

  • This question is about the min-heap. A min-heap with 10 elements is given in the following...

    This question is about the min-heap. A min-heap with 10 elements is given in the following array format. The following three sub-questions all refer to this min-heap i 1 2 3 4 5 6 7 8 9 10 A[i] 11 22 33 44 55 66 77 88 99 100 Show the result after applying heap-decrease-key(A, 6, 12) to the min-heap at the top of this page: i 1 2 3 4 5 6 7 8 9 10 A[i] Show the...

  • Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60,...

    Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers keys in post-order - Retrieve the integers keys in pre-order - Draw a binary search tree after node 58 is deleted b) Create a Hash Table using the methods described below. Show the final array after all integer keys are inserted. Assumes that...

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