The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
31 views

https://gateoverflow.in/459/gate2008-47
here if we insert all elements together and then call heapify function then it’ll take O(logn) time. why answer is O(n)?

asked in Algorithms by Active (2.2k points) | 31 views
+1

if you call the Heapify then for n element then it will take  = O(n log n) time.

The Solution of this problem is 

Take All the 2*n element and call the Build Heap().

So, It will take  O(2n) = O(n) time.

0
oh ok

Please log in or register to answer this question.

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

47,005 questions
51,324 answers
177,495 comments
66,668 users