Explain how each part of diagram(a) corresponds to each part of diagram(b).

icon
Related questions
Question

Explain how each part of diagram(a) corresponds to each part of diagram(b).

2
8
4
14
10
16
(a)
9
10
3
3 4 5 6 7 8 9 10
16|14|10|8|79|3|2|4|1
(b)
Figure 6.1 A max-heap viewed as (a) a binary tree and (b) an array. The number within the circle
at each node in the tree is the value stored at that node. The number above a node is the corresponding
index in the array. Above and below the array are lines showing parent-child relationships; parents
are always to the left of their children. The tree has height three; the node at index 4 (with value 8)
has height one.
Transcribed Image Text:2 8 4 14 10 16 (a) 9 10 3 3 4 5 6 7 8 9 10 16|14|10|8|79|3|2|4|1 (b) Figure 6.1 A max-heap viewed as (a) a binary tree and (b) an array. The number within the circle at each node in the tree is the value stored at that node. The number above a node is the corresponding index in the array. Above and below the array are lines showing parent-child relationships; parents are always to the left of their children. The tree has height three; the node at index 4 (with value 8) has height one.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer