下方代码段通过插入排序的方法完成排序,空白处应补充的代码是(
def insertion_sort(arr):
for i in range(1, len(arr)):
current = arr[i]
pre_index = i - 1
whilepre_index >= 0 and arr[pre_index] > current:
_________________________________
pre_index -= 1
arr[pre_index + 1] = current
return arr
arr[pre_index] = arr[pre_index+1]
arr[i] = arr[i+1]
arr[pre_index+1] = arr[pre_index]
arr[i+1] = arr[i]