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

An array of integers of size n can be converted into a heap by adjusting the heaps rooted at each internal node of the complete binary tree starting at the node ⌊(n - 1) /2⌋, and doing this adjustment up to the root node (root node is at index 0) in the order ⌊(n - 1)/2⌋, ⌊(n - 3)/ 2⌋, ....., 0. The time required to construct a heap in this manner is

  1. O(log n)
  2. O(n)
  3. O (n log log n)
  4. O(n log n)

I dont get what question meant

can ny implemented on following array

1,2,3,4,5 ?

asked in DS by Active (2.5k points) | 86 views
it is a GATE question.rt?

By built heap method it will take O(N) time
ya i know that

but u can implement it  on  taking given array .

Please log in or register to answer this question.

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

29,006 questions
36,838 answers
34,718 users