第15552题 单选
给定Python实现的bubbleSort()函数的时间复杂度是多少?
def bubbleSort(lst):
    n = len(lst)
    for i in range(n):
        for j in range(n-i-1):
            if lst[j] > lst[j+1]:
                lst[j], lst[j+1] = lst[j+1], lst[j]

lstData = [11, 2, 3, 7, 15]
bubbleSort(lstData)
print(lstData)
A

O(n)

B

O(n²)

C

O(n log n)

D

O(1)

程序运行统计
暂无判题统计