GATE CSE
First time here? Checkout the FAQ!
x
0 votes
38 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)   | 38 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

0 votes
1 answer
1
asked in DS by Sahil Gupta Active (1.5k points)   | 114 views


Top Users Mar 2017
  1. rude

    4758 Points

  2. sh!va

    3004 Points

  3. Rahul Jain25

    2830 Points

  4. Kapil

    2634 Points

  5. Debashish Deka

    2428 Points

  6. 2018

    1514 Points

  7. Vignesh Sekar

    1416 Points

  8. Akriti sood

    1298 Points

  9. Bikram

    1286 Points

  10. Sanjay Sharma

    1076 Points

Monthly Topper: Rs. 500 gift card

21,468 questions
26,791 answers
61,029 comments
23,032 users