程序段如下:
1 def fun(arr: list): 2 n = len(arr) 3 for i in range(n - 1): 4 for j in range(0, n - i - 1): 5 if arr[j] > arr[j + 1]: 6 arr[j], arr[j + 1] = arr[j + 1], arr[j]
O(n)
O(2n)
O(n3)
O(n2)