填空题:下面程序是选择排序的实现,请填空 bottom|bottom+1 。 def selSort(nums):
下面程序是选择排序的实现,请填空(答案中不要有空格)。
def selSort(nums):
n = len(nums)
for bottom in range(n-1):
mi = bottom
for i in range(_________, n):
if nums[i] < nums[mi]:
mi = i
nums[bottom], nums[mi] = nums[mi], nums[bottom]
return nums
numbers = [49, 38, 65, 97, 76, 13, 27, 49]
print(selSort(numbers))
答案:
第1空:bottom || bottom+1 ||