Question 9525 – Heap-Tree
January 17, 2024Question 7137 – NVS PGT CS 2019 Part-A
January 18, 2024Question 9323 – Heap-Tree
In a binary max heap containing n numbers, the smallest element can be found in time
Correct Answer: A
Question 7 Explanation:
In a MAX heap the smallest values of the heap will always be present on the last level of heap and time complexity of reaching the last level of heap is O(n).
We have to search all the elements to reach the smallest element and heap using linear search.
To traverse all elements using linear search will take O(n) time.
We have to search all the elements to reach the smallest element and heap using linear search.
To traverse all elements using linear search will take O(n) time.
O(n)
O(log n)
O(log log n)
O(1)
Subscribe
Login
0 Comments