Question DSA-HEAP-0080
HardWhat is the time complexity of finding the k-th smallest element by building a min-heap and popping k times?
- A.
O(k)
- B.
O(n + k log 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 is the time complexity of finding the k-th smallest element by building a min-heap and popping k times?
O(k)
O(n + k log n)
Sign up free to see the answer and a step-by-step explanation.
O(nk)
O(n log n)