第26610题
判断给定Python递归快速排序代码的说法正误

有关下面Python代码的说法,正确的是( )。

def qSort(lst):
    if len(lst) <= 1:
        return lst
    else:
        Pivot = lst[0]
        Less = [x for x in lst[1:] if x <= Pivot]
        Greater = [x for x in lst[1:] if x > Pivot]
        return qSort(Less) + [Pivot] + qSort(Greater)

lstA = [1,2,11,12,21,21,2,3,41,4,3]
lstB = qSort(lstA)
print(lstA,lstB)
A

代码中qSort()函数不是稳定排序

B

代码中qSort()函数空间复杂度为O(1)

C

代码中qSort()函数是就地排序

D

代码中qSort()函数是外排序,因为排序后的结果保存在新的内存空间即外空间