更改

跳到导航 跳到搜索
添加29字节 、 2022年10月8日 (六) 14:49
第9行: 第9行:  
* 对剩下的元素,和堆顶比较,'''若更大'''则替换堆顶
 
* 对剩下的元素,和堆顶比较,'''若更大'''则替换堆顶
    +
时间复杂度 O(n logk)。
 
<syntaxhighlight lang=python>
 
<syntaxhighlight lang=python>
 
def topk(xs: list[int], k: int):
 
def topk(xs: list[int], k: int):

导航菜单