Skip to content

Commit

Permalink
sorts: Adjust upper bound for insertion sort in merge_sort
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Nov 17, 2023
1 parent 426d042 commit c264c48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sorts/src/merge_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ where
return;
}
// Use insertion sort for small subarrays.
const CUTOFF: usize = 7;
const CUTOFF: usize = 24;
if high <= low + CUTOFF - 1 {
insertion_sort(&mut arr[low..=high]);
return;
Expand Down

0 comments on commit c264c48

Please sign in to comment.