update median thing

This commit is contained in:
jacekpoz 2024-05-09 15:51:30 +02:00
parent 7c45c5e026
commit 2d1d836575
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -79,7 +79,7 @@ impl NormalSelect {
for i in (lo..=hi).step_by(k) {
if i + (k - 1) <= hi {
self.insertion_sort(list, i, i + (k - 1));
medians[index] = list[i + 2];
medians[index] = list[i + (k / 2)];
index += 1;
} else {
self.insertion_sort(list, i, hi);