Question

Perform the following operations on the nodes {12, -1, 4, 5, 9, 20, 14, 6, 25,...

Perform the following operations on the nodes {12, -1, 4, 5, 9, 20, 14, 6, 25, 11}:

1. Perform build heap assuming an initially empty heap.

2. Pop the nodes {-1,9,11,25}

3. Insert nodes {0,15,21}

4. Perform heap sort

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Perform the following operations on the nodes {12, -1, 4, 5, 9, 20, 14, 6, 25,...
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
  • Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of...

    Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of height h is 2h+1 − 1. 2. A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leaves in a nonempty binary tree. 3. What is the minimum number of nodes in an AVL tree of height 15? 4. Show the result of inserting 14, 12, 18, 20, 27, 16,...

  • Given a singly linked list contains 5 nodes, which simply shows as 5->4->3->2->1, what is the...

    Given a singly linked list contains 5 nodes, which simply shows as 5->4->3->2->1, what is the value that you can find in the second node of the remaining list if the following statements are applied? Assume head reference refers the first node of the list. Node prev = head; Node curr = head. next; while(curr.next!=null) { if(prev.element > 3) { prev = curr; curr = curr.next; } else break; } head = prev.next; Question 3 options: 3 2 4 1...

  • Data structures Exercises: For the following binary tree (Index-Value): 0 1 2 3 4 5 6...

    Data structures Exercises: For the following binary tree (Index-Value): 0 1 2 3 4 5 6 7 8 9 A C E G B P D X F H Give the pre-order traversal. Give the post-order traversal. Give the in-order traversal. Determine the height of the tree. Using these values: 8 6 4 3 5 9 2 1 6 Build a binary search tree. Build an AVL Tree. Build a 2-3 Tree. Build a min-heap. Build a max-heap. Apply a...

  • 1. Consider the following unordered list: 20, 35, 25, 10, 40, 50, 45. Perform heap sort...

    1. Consider the following unordered list: 20, 35, 25, 10, 40, 50, 45. Perform heap sort to sort this list in nondecreasing (ascending) order. a. Perform the bottom-up method to arrange these values into a max heap. Show the heapify operations on each relevant subtree. (10 points) b. Show the tree representation and the array representation of these numbers after every dequeue operation. Remember that dequeue does not delete a number. Dequeue will instead remove that number from the heap...

  • Using C++, data structures, C++ STL, inputs and expected outputs are shown below. Max Heap Heap...

    Using C++, data structures, C++ STL, inputs and expected outputs are shown below. Max Heap Heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either > (in a max heap) or s (in a min heap) the key of C. The node at the "top" of the heap (with no parents) is called the root node. In binary-tree based heap, it...

  • Given the following array of integers (of capacity 20) with 12 items: 0 1 2 3...

    Given the following array of integers (of capacity 20) with 12 items: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 4 10 15 5 7 11 3 9 13 1 6             Index of last element = 11 Does this array represent a min heap? If not, convert it to a min heap (i.e., “heapify” it). Please show all steps.

  • (a) On an initially empty red-black tree, perform the following operations in this order: insert(1), insert(3),...

    (a) On an initially empty red-black tree, perform the following operations in this order: insert(1), insert(3), insert(5), insert(6), insert(7), delete(1) Show all the intermediate steps of your work (b) We can get another sorting algorithm by first inserting all the keys into a red-black tree, and then performing an in-order traversal of the tree. What's the time complexity of this algorithm? (As always, use O or Θ notation.)

  • Class 1 2 3 4 6 32% 5-Year 20% 19% 12% 11% 6% 7-Year 14% 25%...

    Class 1 2 3 4 6 32% 5-Year 20% 19% 12% 11% 6% 7-Year 14% 25% 17% 13% 9% 9% 9% 4% A New Machine is expected to increase EBDT by $25,000 per year for 5 years. . The incremental depreciation for each year is given below. TAX RATE = .40 Year 1 2 Incremental Depreciation $30,000 $45,000 $15,000 $7000 What is the After-tax Operating Cash Flow for Year 2 (CF2)? $25,000 $27,400 $17,800 $33,000 $36,200 col N

  • 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.

  • Zhang: CSE 330 Winter 2019 Final Examination (I hour 50 minutes) 7IPage Show the result of...

    Zhang: CSE 330 Winter 2019 Final Examination (I hour 50 minutes) 7IPage Show the result of inserting 18, 12, 3, 14,5, 6, 10, 16, 2, 9, 26, 8, and 11, one at a time, into an initially empty binary heap. 4. Show the result of performing TWO deleteMinO operations in the following binary heap. s. 5 9 0 11) (60(25 16

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