update median thing
This commit is contained in:
parent
7c45c5e026
commit
2d1d836575
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ impl NormalSelect {
|
||||||
for i in (lo..=hi).step_by(k) {
|
for i in (lo..=hi).step_by(k) {
|
||||||
if i + (k - 1) <= hi {
|
if i + (k - 1) <= hi {
|
||||||
self.insertion_sort(list, i, i + (k - 1));
|
self.insertion_sort(list, i, i + (k - 1));
|
||||||
medians[index] = list[i + 2];
|
medians[index] = list[i + (k / 2)];
|
||||||
index += 1;
|
index += 1;
|
||||||
} else {
|
} else {
|
||||||
self.insertion_sort(list, i, hi);
|
self.insertion_sort(list, i, hi);
|
||||||
|
|
Loading…
Reference in a new issue