Question DSA-SORT-0065
HardWhat is the output of this code?
import heapq
a = [5, 1, 9, 3, 7, 2]
heapq.heapify(a)
print(a[0], [heapq.heappop(a) for _ in range(3)], len(a))
- A.
1 [1, 3, 5] 3
- B.
1 [1, 2, 3] 6
- C.
Sign up free to see the answer and a step-by-step explanation.