In a min-heap
with n elements with the smallest element at the root, the 7th smallest element can be found in time -
a) Θ(nlogn)
b) Θ(n)
c) Θ(logn)
d) Θ(1)
==========================================================================
I am so confused between option c
and d
. Do we need to do Extract Min 7 times
or simply do comparisons as at root level - 0 comparison, at 1st level - 3 comparison between root and LC and RC and so on.