Data update

This commit is contained in:
Ingy dot Net 2024-04-19 16:56:29 -07:00
parent 0df55f9f24
commit aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions

View file

@ -1,8 +1,8 @@
val .countingSort = f(.list) {
val .countingSort = fn(.list) {
val .min, .max = minmax(.list)
var .count = [0] x (.max-.min+1)
var .count = [0] * (.max-.min+1)
for .i in .list { .count[.i-.min+1] += 1 }
for .i of .count { _for ~= .count[.i] x [.i+.min-1] }
for .i of .count { _for ~= .count[.i] * [.i+.min-1] }
}
val .data = [7, 234, -234, 9, 43, 123, 14]