Question
Download Solution PDFIn a binary max heap containing n numbers, the smallest element can be found in ______ time.
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFThe 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).
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.