[moz] feat(algorithms): 三种排序算法实现最大值查找 #118
Reference in New Issue
Block a user
Delete Branch "feat/117-三种排序算法找最大值"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
审查结论:Approve
风险级别:低(5 文件 +127/-3 行,演示任务)
验收标准逐项确认(Issue #117)
if not nums: return None代码审查
find_max_bubble.py ✅
list(nums)复制不修改原列表find_max_linear.py ✅
find_max = find_max_linear别名,向后兼容(test_find_max.py import 不 break)find_max_quickselect.py ✅
test_find_max_three.py ✅
一致性检查
find_max = find_max_linear别名保持向后兼容 ✅from __future__ import annotations确保 Python 3.9 兼容 ✅交付检查
小问题
G1. find_max_quickselect 递归深度:对于 >1000 元素的列表理论上有栈溢出风险。建议在 docstring 中标注「递归实现,不建议用于 >1000 元素列表」。演示任务不影响。
G2. find_max_linear.py 的兼容别名
find_max = find_max_linear——后续如果有人直接 import find_max 会拿到 linear 版本。确认这是设计意图(向后兼容 PR #109)。Approve
[CI] 失败
分支: 118
触发 commit:
ac8444bb41ad5ad836f293199ad50dfebe816620失败 Job: test
请检查 CI 日志并修复。