Question

1.(10 pts) Contrast a heap with a binary search tree by inserting the numbers 60, 30,...

1.(10 pts) Contrast a heap with a binary search tree by inserting the numbers 60, 30, 40, 50, 20, 10 first in a BST and then in a min-heap. Draw the resulting BST on the left and the heap on the right. You may draw any valid BST or Heap that contain the provided values

2. (5 pts) In section 11.1, the book mentions that heaps are **complete** binary trees, what does that mean? Demonstrate by drawing an example of a binary tree with 5 nodes that is not complete and one that is complete.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANS 1-

ANS 2-

Heaps are complete binary tree because-

All the levels in a heap are completely filled except the last one.

Example-

Add a comment
Know the answer?
Add Answer to:
1.(10 pts) Contrast a heap with a binary search tree by inserting the numbers 60, 30,...
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
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