单选题

下方代码段通过插入排序的方法完成排序,空白处应补充的代码是(

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

A

arr[pre_index] = arr[pre_index+1]

B

arr[i] = arr[i+1]

C

arr[pre_index+1] = arr[pre_index]

D

arr[i+1] = arr[i]

赣ICP备20007335号-2