We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdcd33e commit 53958a4Copy full SHA for 53958a4
example/chen_sort.dart
@@ -194,8 +194,12 @@ void chenSort(List<int> list) {
194
for (final bucket in buckets) {
195
if (bucket != null) {
196
if (bucket.length > 1) {
197
- /// The sort method here represents the fastest comparison-type algorithm (Quick sort, Tim sort, etc.)
198
- bucket.sort(compare);
+ if (bucket.length >= 1000) {
+ chenSort(bucket);
199
+ } else {
200
+ /// The sort method here represents the fastest comparison-type algorithm (Quick sort, Tim sort, etc.)
201
+ bucket.sort(compare);
202
+ }
203
for (final element in bucket) {
204
list[index++] = element;
205
}
0 commit comments