pocketpy/tests/703_heapq.py
2025-12-04 19:52:22 +08:00

9 lines
180 B
Python

from heapq import heapify, heappop, heappush
from random import randint
a = [randint(0, 100) for i in range(1000)]
b = sorted(a)
heapify(a)
for x in b:
assert heappop(a) == x