Skip to content

UGC NET CS 2023Data Structures and Algorithms › Data StructuresVerified

UGC NET CS 2023 PYQ: Consider the following statements about heap sort algorithm: The MAX-HEAPIFY procedure which runs in…

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. A
    $\text{I, II}$ only
  2. B
    $\text{I, III}$ only
    Correct answer
  3. C
    $\text{II, IV}$ only
  4. D
    $\text{I, II, III, IV}$

Answer

(B) $\text{I, III}$ only

Approach

Recall the standard CLRS running times of the heap operations and check each statement.

Reviewed by UGC IQ Editorial Team.