Код: Выделить всё
def heappeak(heap):
smallest = heappop(heap)
heappush(heap, smallest)
return smallest
Подробнее здесь: https://stackoverflow.com/questions/175 ... -in-python
Код: Выделить всё
def heappeak(heap):
smallest = heappop(heap)
heappush(heap, smallest)
return smallest