第10977题 单选题
Python实现升序插入排序的代码空白处应填入的正确语句是?
def insertion_sort_optimized(arr):
  n = len(arr)
  for i in range(1, n):
    key = arr[i] # 当前待插入元素
    j = i - 1
    while j >= 0 and arr[j] > key:
      arr[j + 1] = arr[j] # 元素后移
      j -= 1
    _______________ # 插入元素到正确位置
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析