GATE CSE
First time here? Checkout the FAQ!
x
0 votes
25 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)   | 25 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)   | 103 views
Top Users Feb 2017
  1. Arjun

    4902 Points

  2. Bikram

    4102 Points

  3. Habibkhan

    3748 Points

  4. Aboveallplayer

    2986 Points

  5. sriv_shubham

    2288 Points

  6. Smriti012

    2222 Points

  7. Arnabi

    1946 Points

  8. Debashish Deka

    1920 Points

  9. mcjoshi

    1614 Points

  10. sh!va

    1462 Points

Monthly Topper: Rs. 500 gift card

20,793 questions
25,951 answers
59,558 comments
21,976 users