recategorized by
314 views
0 votes
0 votes
to find the maximum elements in a min heap represnted by an array can be computed in ____________ time

a. theta n

b.theta n2

c.theta nlogn

d.theta 1
recategorized by

1 Answer

1 votes
1 votes

In a min-heap, the largest element will be present in one of the leaves of the heap. Since there can be n/2 leaves, we need to perform a search in those n/2 leaves, the search will have to be linear.

So, the best we can get is $\theta (n)$

Related questions

0 votes
0 votes
0 answers
1
srestha asked Aug 16, 2018
1,055 views
a)Deletion of smallest element in heapb)Insertion of an element in a heap will take$O(n)$ or $O(logn)$ time?
0 votes
0 votes
0 answers
4
manvi_agarwal asked Sep 10, 2018
596 views
https://gateoverflow.in/?qa=blob&qa_blobid=17275535249024428371