Question: Below are the heaps represented in array format. Perform the corresponding operations specified for each of them and draw the heaps ( tree form )

Below are the heaps represented in array format. Perform the corresponding operations
specified for each of them and draw the heaps (tree form).
a. Min-heap: 15,20,33,40,54,38,42 add(18)
b. Min-heap: [5,12,15,27,25,34];add(9)
c. Max-heap: 70,40,38,20,4; remove()
d. Regular heap: [42,14,34,2611]; remove()
Given the following tree traversals, construct the trees.
a. Pre-order: A, B, D, E, C, F
In-order: D, B, E, A, F, C
b. Pre-order: 1,2,4,5,3,6,7
Post-order: 4,5,2,6,7,3,1
c. In-order: G, D, H, B, A, E, C, F
Post-order: G, H, D, B, E, F, C, A

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!