edited by
437 views
0 votes
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{A, B}$ only
  2. $\text{A, C}$ only
  3. $\text{B, D}$ only
  4. $\text{A, B, C, D}$

 

edited by

1 Answer

0 votes
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)

Related questions

0 votes
0 votes
0 answers
3
admin asked Jul 28, 2023
180 views
There are $M$ points on one straight line $A B$ and $n$ points on another straight line $A C$ none of them being $A$. How many triangles can be formed with these points a...