(a) Consider a heap stored in an array a= [25, 17, 23, 14, 8, 21, 12, 7]. Write the updated array when we apply extractMax operation. (b) Consider the same heap a = [25, 17, 23, 14, 8, 21, 12, 7]. Write the updated array when we apply the operation insert (24). (c) Specify the best-case running time of extractMax() in a heap formed by n distinct items. If your answer is e(f(n)), you must provide an example, with large n, for which extractMax() takes (f(n)).

icon
Related questions
Question
(a) Consider a heap stored in an array a = = [25, 17, 23, 14, 8, 21, 12,7]. Write the updated
array when we apply extractMax operation.
(b) Consider the same heap a = [25, 17, 23, 14, 8, 21, 12, 7]. Write the updated array when
we apply the operation insert (24).
(c) Specify the best-case running time of extract Max() in a heap formed by n distinct
items. If your answer is (f(n)), you must provide an example, with large n, for which
extract Max() takes (f(n)).
Transcribed Image Text:(a) Consider a heap stored in an array a = = [25, 17, 23, 14, 8, 21, 12,7]. Write the updated array when we apply extractMax operation. (b) Consider the same heap a = [25, 17, 23, 14, 8, 21, 12, 7]. Write the updated array when we apply the operation insert (24). (c) Specify the best-case running time of extract Max() in a heap formed by n distinct items. If your answer is (f(n)), you must provide an example, with large n, for which extract Max() takes (f(n)).
Expert Solution
steps

Step by step

Solved in 7 steps with 2 images

Blurred answer