Saturday, September 21, 2024
Google search engine
HomeData Modelling & AIData Structures | Heap | Question 12

Data Structures | Heap | Question 12

Which of the following Binary Min Heap operation has the highest time complexity?
(A) Inserting an item under the assumption that the heap has capacity to accommodate one more item
(B) Merging with another heap under the assumption that the heap has capacity to accommodate items of other heap
(C) Deleting an item from heap
(D) Decreasing value of a key

Answer: (B)
Explanation: The merge operation takes O(n) time, all other operations given in question take O(Logn) time.

The Binomial and Fibonacci Heaps do merge in better time complexity.
Quiz of this Question

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

RELATED ARTICLES

Most Popular

Recent Comments