let rec
qsort = function | [ ] -> [ ] | h
:: t -> qsort [ for e in h
do if ( e
<= h
) then yield e
] @ [ h] @
qsort [ for e in h
do if ( e
> h
) then yield e
]
let r = new System.Random ( )
let main( ) =
let sample = List.init 300 ( fun _-> r.Next ( int .MaxValue ) )
System.
Console .
WriteLine ( qsort sample
)
bGV0IHJlYyBxc29ydCA9IGZ1bmN0aW9uIHwgW10gICAtPiBbXQogICAgICAgICAgICAgICAgICAgICAgICAgfCBoOjp0IC0+IHFzb3J0IFtmb3IgZSBpbiBoIGRvIGlmIChlIDw9IGgpIHRoZW4geWllbGQgZV0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAIFtoXSBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXNvcnQgW2ZvciBlIGluIGggZG8gaWYgKGUgPiBoKSB0aGVuIHlpZWxkIGVdCgpsZXQgciA9IG5ldyBTeXN0ZW0uUmFuZG9tKCkKCmxldCBtYWluKCkgPSAKICAgICAgICBsZXQgc2FtcGxlID0gTGlzdC5pbml0IDMwMCAoZnVuIF8tPiByLk5leHQoaW50Lk1heFZhbHVlKSkKICAgICAgICBTeXN0ZW0uQ29uc29sZS5Xcml0ZUxpbmUocXNvcnQgc2FtcGxlKSA=
compilation info
/home/Ka0mQ6/prog.fs(9,56): error FS0039: The field, constructor or member 'MaxValue' is not defined
/home/Ka0mQ6/prog.fs(10,40): error FS0001: The type 'int' is not compatible with the type 'seq<int>'
stdout