mirror of
https://github.com/onyx-and-iris/grokking-algorithms.git
synced 2024-11-15 17:30:52 +00:00
11 lines
244 B
Python
11 lines
244 B
Python
|
import heapq
|
||
|
|
||
|
customers = []
|
||
|
heapq.heappush(customers, (2, "Harry"))
|
||
|
heapq.heappush(customers, (3, "Charles"))
|
||
|
heapq.heappush(customers, (1, "Riya"))
|
||
|
heapq.heappush(customers, (4, "Stacy"))
|
||
|
|
||
|
while customers:
|
||
|
print(heapq.heappop(customers))
|