第26748题 单选题
下列关于Python实现求最大值的find_max函数的算法相关说法,错误的是?
def find_max(nums):
    if not nums:
        raise ValueError("输入数组不能为空")
    if len(nums) == 1:
        return nums[0]
    mid = len(nums) // 2
    return max(
        find_max(nums[:mid]),
        find_max(nums[mid:])
    )
print(find_max([1,2,2,11,21,1,2,3]))
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析