Exercises
- What will be the time complexity for deleting an arbitrary element from the
min-heap
? - What will be the time complexity for finding the
kth
smallest element from themin-heap
? - What will be the worst-case time complexity for ascertaining the smallest element from a binary
max-heap
and binarymin-heap
? - What will be the time complexity to make a
max-heap
that combines twomax-heap
each of sizen
? - The level order traversal of
max-heap
is12
,9
,7
,4
, and2
. After inserting new elements1
and8
, what will be the finalmax-heap
and the level order traversal of the finalmax-heap
? - Which of the following is a binary
max-heap
?
Figure 7.21: Example trees
Join our community on Discord
Join our community’s Discord space for discussions with the author and other readers: https://packt.link/MEvK4