Skip to content

Commit f742699

Browse files
committed
Fix heapselect
1 parent 02eadee commit f742699

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

benchmark.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def bench_heapselect(values, K):
5555
lst = values.copy()
5656
# Partition in-place so that the element at index (K-1) is in the correct position.
5757
selectlib.heapselect(lst, K - 1)
58-
return lst[:K]
58+
result = lst[:K]
59+
result.sort()
60+
return result
5961

6062
# List of methods to benchmark
6163
methods = {

plot.png

-6 KB
Loading

0 commit comments

Comments
 (0)