When a heap is created to dynamically track a min value, after initialising an empty heap, do I actually need to call heapq.heapify(heap)? Or rather hq.heappop() and hp.heappush() will automatically do the job.. Thanks for the help!
import heapq as hp
heap = []
hp.heapify(heap) # is this line redundant?
for val in range(1, 100):
hp.heappush(heap, val)
print(heap[0])