In a binary max heap containing n numbers, the smallest element can be found in ______ time.  

This question was previously asked in
UGC NET Computer Science (Paper 2) 2020 Official Paper
View all UGC NET Papers >
  1. O(n)
  2. O(log2 n)
  3. O(1)
  4. O(log2 log2 n)

Answer (Detailed Solution Below)

Option 1 : O(n)
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
16.1 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

The correct answer is option 1.

Key Points

  • The heap's smallest values will always be present on the last level or second last of the heap in a MAX heap, and the time complexity of reaching the last level of the heap is O(n).
  • We must use a linear search to search all of the elements in order to find the smallest element and heap.
  • It will take O(n) time to traverse all of the elements using linear search. 

Hence the correct answer is O(n).

Latest UGC NET Updates

Last updated on Jul 7, 2025

-> The UGC NET Answer Key 2025 June was released on the official website ugcnet.nta.ac.in on 06th July 2025.

-> The UGC NET June 2025 exam will be conducted from 25th to 29th 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: lucky teen patti teen patti bonus teen patti teen patti real cash