RosettaCodeData/Task/Sort-an-integer-array/F-Sharp/sort-an-integer-array.fs
2023-07-01 13:44:08 -04:00

7 lines
175 B
FSharp

// sorting an array in place
let nums = [| 2; 4; 3; 1; 2 |]
Array.sortInPlace nums
// create a sorted copy of a list
let nums2 = [2; 4; 3; 1; 2]
let sorted = List.sort nums2