GATE CSE
First time here? Checkout the FAQ!
x
0 votes
61 views

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 (2k points)   | 61 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.

Related questions

+1 vote
2 answers
3
asked in DS by thor Boss (8.7k points)   | 202 views


Top Users Aug 2017
  1. Bikram

    4888 Points

  2. ABKUNDAN

    4704 Points

  3. akash.dinkar12

    3480 Points

  4. rahul sharma 5

    3142 Points

  5. manu00x

    3012 Points

  6. makhdoom ghaya

    2470 Points

  7. just_bhavana

    2382 Points

  8. stblue

    2130 Points

  9. Tesla!

    2066 Points

  10. joshi_nitish

    1758 Points


25,002 questions
32,124 answers
74,782 comments
30,176 users