For each of the following two arrays that are interpreted as binary (2-ary) “min-heaps”,…
- User
For each of the following two arrays that are interpreted as binary (2-ary) “min-heaps”, state whether they are in fact correct binary min-heaps or violate a property. If one is a correct min-heap, then show what it looks like after you insert the key “2”, and then show it again after you now remove the minimum (after having inserted “2”). You don’t have to show the intermediate steps, but if you don’t show them and the final answer is wrong, we will not be able to give you a lot of partial credit.
If one of the two heaps we gave you is not a correct binary min-heap, then point out everything that is wrong with it. In that case, you don’t need to insert “2” or remove anything.
[1, 4, 3, 7, 10, 6, 5, 9, 8, 11] [1, 6, 3, 9, 7, 4, 5, 8, 10] Your answer should not be in array form like ours, but instead be drawn as a tree, either for the trees you want us to see, or by annotating the mistakes in the tree(s) we gave you.
- Assistant