Question DSA-HEAP-0015
HardWhat is the output of this code?
import heapq
print(list(heapq.merge([1, 4], [2, 5], [3, 6])))
- A.
[1, 3, 5, 2, 4, 6]
- B.
[1, 2, 3, 4, 5, 6]
- 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 output of this code?
import heapq
print(list(heapq.merge([1, 4], [2, 5], [3, 6])))
[1, 3, 5, 2, 4, 6]
[1, 2, 3, 4, 5, 6]
Sign up free to see the answer and a step-by-step explanation.
[6, 5, 4, 3, 2, 1]
[1, 4, 2, 5, 3, 6]