edited by
1,034 views
0 0 votes

Consider the following statements about heap sort algorithm:

  1. The MAX-HEAPIFY procedure which runs in $\mathrm{O} \lg (n)$ time, is the key to maintaining the max heap property
  2. The BUILD-MAX-HEAP procedure, which runs in $\mathrm{O} \lg (n)$ time, produces max-heap from an unordered input array
  3. The MAX-HEAP-INSERT, which runs in $\text{O}$ $(\lg n)$ time, implements the insertion operation
  4. The HEAP-INCREASE-KEY procedure runs in $\text{O}$ $(\mathrm{n} \lg n)$ time , to set the key of new node of its correct value

Choose the correct answer from the options given below:

  1. $\text{I, II}$ only
  2. $\text{I, III}$ only
  3. $\text{II, IV}$ only
  4. $\text{I, II, III, IV}$

1 Answer

0 0 votes
Ans : B. A and C are correct.

This is taken as it is from CLRS book (Heap chapter).

BUILD-MAX-HEAP runs in O(n) time.

 HEAP-INCREASE-KEY runs in runs in O(lg n)
Answer:
Position:
Show:

Related questions

1 1 vote
1 1 answer
1.2k
1.2k views
reena_kandari asked Jul 30, 2016
1,227 views
The number of elements that can be sorted in time using heap sort ?
2 2 votes
1 answers 1 answer
2.4k
2.4k views
shivani2010 asked Jun 15, 2016
2,398 views
The time complexity to build a heap with a list of n numbers isO(log n)O(n)O(n logn)O(n$^2$)
1 1 vote
1 1 answer
1.6k
1.6k views
LavTheRawkstar asked Sep 9, 2018
1,565 views
Sort The Following Sequence of input using Heap sort.{ 10 , 2 , 1 , 5, 3 ,8 ,11,24 ,7 }Please show the output at every pass because i am getting confused.
1 1 vote
1 answers 1 answer
1.8k
1.8k views
Himanshu1 asked Jan 20, 2016
1,782 views
What is the Best Case run time of Heap Sort ?A. $O(1)$B. $O(n)$C. $O(n \log n)$D. $O(\log n)$