Question 12 (5 points) Build a heap for the following sequence of values, using the algorithm introduced in the class (a
Posted: Sun Jul 10, 2022 11:23 am
Question 12 (5 points) Build a heap for the following sequence of values, using the algorithm introduced in the class (add elements one by one). Given: 20 17 13 5 11 23 29 40 35 52 16 38 After building the heap implement it as an array. Show the array that represents that heap. 52 40 38 35 17 23 29 5 20 13 16 11 52 40 38 35 17 23 20 5 29 11 16 13 52 40 38 35 17 23 29 5 20 11 16 13 40 52 38 35 17 23 29 5 20 11 16 13 52 40 35 38 17 23 29 5 20 11 16 13 Question 13 (3 points) Suppose a heap is created by enqueuing elements in this order: 15, 10, 25, 8, 30. Then the order of the nodes in the underlying binary tree, from level 0 to level 2, left to right, is: 30, 25, 15, 8, 10. 30, 15, 25, 8, 10. 8, 10, 15, 25, 30. 15, 10, 25, 8, 30. 30, 25, 15, 10, 8.