Question DSA-HEAP-0058
MediumWhat does decrease-key do in a min-heap of size n, and how long does it take?
- A.
Sorts the heap in O(n log n)
- B.
Increases all keys in O(n)
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Heaps and Priority Queues question
What does decrease-key do in a min-heap of size n, and how long does it take?
Sorts the heap in O(n log n)
Increases all keys in O(n)
Sign up free to see the answer and a step-by-step explanation.
Deletes the key in O(1)
Lowers a key and sifts it up, in O(log n)