Consider the following statements about heap sort algorithm:

A. The MAX-HEAPIFY procedure which runs in O lg (n) time, is the key to maintaining the max heap property

B. The BUILD-MAX-HEAP procedure, which runs in O lg (n) time, produces max-heap from an unordered input array

C. The MAX-HEAP-INSERT, which runs in O (lg n) time, implements the insertion operation

D. The HEAP-INCREASE-KEY procedure runs in O (n lg n) time, to set the key of new node of its correct value

Choose the correct answer from the options given below:

This question was previously asked in
UGC NET Computer Science (Paper 2) 17 June 2023 Official Paper
View all UGC NET Papers >
  1. A, B only
  2. A, C only 
  3. B, D only
  4. A, B, C, D

Answer (Detailed Solution Below)

Option 2 : A, C only 
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
8.7 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

The correct answer is A, C only

Key Points

  • A. The MAX-HEAPIFY procedure which runs in O(lg n) time, is the key to maintaining the max heap property.
    • This statement is true. The MAX-HEAPIFY procedure is responsible for maintaining the max-heap property, and it indeed runs in O(log n) time.
  • B. The BUILD-MAX-HEAP procedure, which runs in O(lg n) time, produces a max-heap from an unordered input array.
    • This statement is incorrect. The BUILD-MAX-HEAP procedure has a time complexity of O(n), not O(log n). It builds a max-heap from an unordered input array in linear time.
  • C. The MAX-HEAP-INSERT, which runs in O(lg n) time, implements the insertion operation.
    • This statement is true. The MAX-HEAP-INSERT operation involves inserting a new element into the max-heap and then maintaining the max-heap property. Its time complexity is O(log n).
  • D. The HEAP-INCREASE-KEY procedure runs in O(n lg n) time to set the key of a new node to its correct value.
    • This statement is incorrect. The time complexity of HEAP-INCREASE-KEY is O(log n), not O(n log n). It is used to increase the key of a node in a max-heap to its correct value.

Therefore, the correct answer is option 2) A, C only.

Latest UGC NET Updates

Last updated on Jun 6, 2025

-> The UGC NET Exam Schedule 2025 for June has been released on its official website.

-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.

-> The UGC NET 2025 online application form submission closed on 12th May 2025.

-> The June 2025 Exam will be conducted from 21st June to 30th June 2025

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

More Sorting Questions

Get Free Access Now
Hot Links: teen patti master plus teen patti - 3patti cards game teen patti pro teen patti mastar