Question

1. Show the result of inserting the following keys into a heap. {22, 12, 17, 23,...

1. Show the result of inserting the following keys into a heap. {22, 12, 17, 23, 16, 25, 18, 13, 14}

2. Show what would happen if two deleteMax operations were completed.

3. Show what would happen when {15, 24} are inserted.

Assume that higher numbers have higher priority.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1. Show the result of inserting the following keys into a heap. {22, 12, 17, 23,...
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
  • Show the 2-3-4 tree after inserting the following keys: 12, 10, 15, 17, 19, 14, 16,...

    Show the 2-3-4 tree after inserting the following keys: 12, 10, 15, 17, 19, 14, 16, 13, 22, 25, and 24. Show the tree after each insertion.

  • Show the result of inserting the following sequence of keys into an initally empty AVL tree:...

    Show the result of inserting the following sequence of keys into an initally empty AVL tree: 15, 10, 11, 16, 12, 30, 18, 20, 19, 17.

  • [Heap] Create a min-binary heap using following numbers (appearing/inserting in the given order): 5, 22, 19,...

    [Heap] Create a min-binary heap using following numbers (appearing/inserting in the given order): 5, 22, 19, 56, 50, 25, 1, 3, 10, 6, 32, 12, 11                [Hint: you can put the items in sequence in a binary tree and then use the buildHeap() method.] [Hashing] Consider a hash table where the hash function h is defined as the modulo 10 operation i.e., for any integer k, h(k) = k % 10 (the ‘modulo 10’ operator returns the remainder when k...

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

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

  • Build a splay tree inserting keys: 2, 13, 17, 4, 7, 19, 5, 8, 22, 6,...

    Build a splay tree inserting keys: 2, 13, 17, 4, 7, 19, 5, 8, 22, 6, 10. Show each step! a. Show the result of accessing keys 5, 8, 7 in order in the splay tree. Show the tree after each access. b. Show the result of deleting keys 10, 8, 7 in the splay tree. Start with the original tree and show the tree after each deletion.

  • Consider the following data. 14 21 23 20 16 19 22 26 15 16 23 25...

    Consider the following data. 14 21 23 20 16 19 22 26 15 16 23 25 24 20 15 20 19 20 21 13 17 17 18 23 26 21 22 15 20 18 25 24 15 23 25 19 21 24 21 19 (a) Develop a frequency distribution using classes of 12–14, 15–17, 18–20, 21–23, and 24–26. Class Frequency 12–14 15–17 18–20 21–23 24–26 Total (b) Develop a relative frequency distribution and a percent frequency distribution using the classes...

  • 14 24 18 23 21 18 16 14 23 17 15 13 19 23 24 14...

    14 24 18 23 21 18 16 14 23 17 15 13 19 23 24 14 16 26 21 14 15 22 16 12 20 23 19 26 20 25 21 19 21 25 23 25 25 19 20 15 (a) Develop a frequency distribution using classes of 12-14, 15-17, 18-20, 21-23, and 24-26. Class Frequency   12-14   15-17   18-20   21-23   24-26     Total (b) Develop a relative frequency distribution and a percent frequency distribution using the classes in part (a). If...

  • Show each red-black tree that results after successively inserting the keys 4 7 12 15 3...

    Show each red-black tree that results after successively inserting the keys 4 7 12 15 3 5 14 18 into an initially empty red-black tree. At the steps were a red-black tree rule is violated, explain how it is corrected Now delete these keys in this order and show each resultant red-black tree 18 15 7 14. At the steps were a red-black tree rule is violated, explain how it is corrected

  • 8. Given the BST below, show the BST that would result after inserting the key of value 180 if sp...

    8. Given the BST below, show the BST that would result after inserting the key of value 180 if splaying is performed starting at the node that was inserted. 100 50 150 40 60 200 30 9. A nice property of splay trees is that each of Find, Insert and Delete takes O(logn) time. TrueFalse? 10. The keys of value N, N-1, N-2... 4, 3, 2, 1 are inserted in this order in a splay tree. What is the final...

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