Skip to content

Commit 36942f1

Browse files
命令错误
进行堆排序得是heap,而不是nums,所以输出的应该是heap
1 parent 616973e commit 36942f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/c01/p04_find_largest_or_smallest_n_items.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ heapq 模块有两个函数:``nlargest()`` 和 ``nsmallest()`` 可以完美解
4848
>>> import heapq
4949
>>> heap = list(nums)
5050
>>> heapq.heapify(heap)
51-
>>> nums
51+
>>> heap
5252
[-4, 2, 1, 23, 7, 2, 18, 23, 42, 37, 8]
5353
>>>
5454

0 commit comments

Comments
 (0)