From b8308cff5d6ea816d999da379716b144e65a814c Mon Sep 17 00:00:00 2001 From: lucas8485 <1443937075@qq.com> Date: Tue, 9 Aug 2022 23:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=9F=E7=9A=84=E5=8F=AA=E6=98=AF=E4=B8=80?= =?UTF-8?q?=E7=82=B9=E5=B0=8F=E9=97=AE=E9=A2=98=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Algorithm-FSharp/QuickSort.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Algorithm-FSharp/QuickSort.fs b/Algorithm-FSharp/QuickSort.fs index f651b2d..c051e6c 100644 --- a/Algorithm-FSharp/QuickSort.fs +++ b/Algorithm-FSharp/QuickSort.fs @@ -1,7 +1,7 @@ module Algorithm_FSharp.QuickSort // 序列切割算法 -// partition : ('a bool) -> 'a list -> 'a list * 'a list +// partition : ('a -> bool) -> 'a list -> 'a list * 'a list // 按pred切割序列,返回的元组中第一个元素是满足条件的元素序列,第二个元素是不满足条件的元素序列 let rec partition pred lst = match lst with // 模式匹配 @@ -12,7 +12,7 @@ let rec partition pred lst = | true -> head::matched, unmatched // 若匹配谓词,则将其追加至matched的头部并返回 | false -> matched, head::unmatched // 若不匹配谓词,将其追加至unmatched的头部并返回 -// quicksort : 'T list -> 'T list +// quicksort : 'a list -> 'a list // 快速排序的F#实现 let rec quicksort i = match i with // 模式匹配