657 views
0 votes
0 votes
How traversal in a heap takes place? Consider a min heap , I think we cannot traverse it like a binary tree  ......For Example if we have to print all elements of heap   Do we need to perform delete operation on root O(1) time then perform Heapify O(lgn) and again perform delete and so on which overall takes O(N) time ?  Whether same is for search as well Plz explain...

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
2
srestha asked Aug 16, 2018
1,033 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
1 answer
3
iarnav asked Jun 20, 2018
691 views
I've read and been told that Heapsort can only be applied on Max heap, but this article for G4G states otherwise - https://www.geeksforgeeks.org/heap-sort-for-decreasing-...
0 votes
0 votes
1 answer
4
akankshadewangan24 asked Dec 2, 2017
295 views
to find the maximum elements in a min heap represnted by an array can be computed in ____________ timea. theta nb.theta n2c.theta nlognd.theta 1