-->
当前位置:首页 > 题库 > 正文内容

填空题:下面程序是选择排序的实现,请填空 bottom|bottom+1 。 def selSort(nums):

Luz3年前 (2022-06-07)题库2052

下面程序是选择排序的实现,请填空(答案中不要有空格)。

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 ||

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。