From https://www.tutorialspoint.com/heap-queue-or-heapq-in-python:
heappush – This function adds an element to the heap without altering the current heap.
If the current heap is not altered, why don't we use the append()
list method? Is the list with the new element heapified only when heappop()
is called?
Am I misunderstanding "without altering the current heap"? Or something else?