# _*_coding:utf-8_*_
import heapq # q->queue 优先队列
import random
li = list(range(10))
random.shuffle(li)
print(li)
heapq.heapify(li) # 建堆(小根堆)
n = len(li)
for i in range(n):
print(heapq.heappop(li), end='')
if i < n - 1:
print(',', end='')
标签:heapq,end,NB,random,堆排序,li,print
From: https://www.cnblogs.com/zylyehuo/p/17625639.html