scala实战学习-快速排序

def qSort(a:List[Int]):List[Int]={
    if(a.length < 2) 
        a
    else 
        qSort(a.filter(a.head > _)) ++
        a.filter(a.head == _) ++
        qSort(a.filter(a.head < _))
}
qSort(List(9,3,2,6,3,7,8,3,6,9,21))

原文地址:https://www.cnblogs.com/fengzzi/p/10040618.html