1. a Is this a min-heap or a max-heap? b. What is the value of the root node? c. What is the left child of node 14? d. What is the left child of node 26?
1. a Is this a min-heap or a max-heap?
b. What is the value of the root node?
c. What is the left child of node 14?
d. What is the left child of node 26?
Step by step
Solved in 3 steps
e. What is the heap-order property for a min-heap? The parent node must have a value ______ than either of its children.
f. If we swapped the left and right child of node 19, would the heap-order property still hold?
g. If we were going to add a node to the heap, where would it be inserted initially? (That is, where would the node be inserted before upheap swapping?)
h. In a min-heap, the parent node must have a value smaller or equal to its children. Is this a valid min-heap?
i. The left child of node 26 is 44. What is the right child of node 26?
j. Any node added to the heap would be inserted as the right child of node 31. If the node value was smaller than 31, what process would we use to restore the heap order?