0 votes 0 votes 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)? Algorithms binary-heap + – aditi19 asked Dec 4, 2018 aditi19 378 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply kumar.dilip commented Dec 4, 2018 reply Follow Share aditi19 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. 1 votes 1 votes aditi19 commented Dec 4, 2018 reply Follow Share oh ok 0 votes 0 votes Please log in or register to add a comment.