ocaml: phase 5.1 radix_sort.ml baseline (LSD radix sort, sentinel 802002)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
LSD radix sort over base 10 digits. Per pass:
- 10 bucket-refs created via Array.init 10 (fun _ -> ref []) (each
closure call yields a distinct list cell)
- scan array, append each value to its digit's bucket
- flatten buckets back to the array in order
Input [170;45;75;90;802;24;2;66]
Output [2;24;45;66;75;90;170;802]
Sentinel: a.(0) + a.(7)*1000 = 2 + 802*1000 = 802002.
Tests array-of-refs with !buckets.(d) deref, list-mode bucket
sort within in-place array sort, unused for-loop var (`for _ =
1 to maxd`).
159 baseline programs total.
This commit is contained in:
@@ -127,6 +127,7 @@
|
||||
"queens.ml": 2,
|
||||
"quickselect.ml": 5,
|
||||
"quicksort.ml": 44,
|
||||
"radix_sort.ml": 802002,
|
||||
"roman.ml": 44,
|
||||
"rolling_hash.ml": 6,
|
||||
"reverse_int.ml": 54329,
|
||||
|
||||
Reference in New Issue
Block a user