$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #19

Fill the heapq function that pushes x onto heap h.

import heapq
heapq.____(h, x)   # push x

Answer: heappush (also accepted: heappush)

heapq.heappush(h, x) adds x keeping the heap invariant.
Play Problem Solving ▸