UnnamedPythonMicroConsole/dependencies/pocketpy/tests/70_heapq.py
2024-04-24 20:54:23 -04: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