Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
5
Task/Knuths-algorithm-S/F-Sharp/knuths-algorithm-s.fs
Normal file
5
Task/Knuths-algorithm-S/F-Sharp/knuths-algorithm-s.fs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
let N=System.Random 23 //Nigel Galloway: August 7th., 2018
|
||||
let s_of_n_creator i = fun g->Seq.fold(fun (n:_[]) g->if N.Next()%(g+1)>i-1 then n else n.[N.Next()%i]<-g;n) (Array.ofSeq (Seq.take i g)) (Seq.skip i g)
|
||||
let s_of_n<'n> = s_of_n_creator 3
|
||||
printfn "using an input array -> %A" (List.init 100000 (fun _->s_of_n [|0..9|]) |> Array.concat |> Array.countBy id |> Array.sort)
|
||||
printfn "using an input list -> %A" (List.init 100000 (fun _->s_of_n [0..9]) |> Array.concat |> Array.countBy id |> Array.sort)
|
||||
Loading…
Add table
Add a link
Reference in a new issue