Skip to content
GitLab
Explore
Sign in
Add heap sort algorithm
Code
Review changes
Check out branch
Download
Patches
Plain diff
Yun.Long
requested to merge
feature/heap-sort
into
main
Feb 25, 2026
Overview
0
Commits
1
Pipelines
0
Changes
4
Expand
Closes
#28
变更内容
sort.py
: 新增
heap_sort()
函数,实现堆排序算法
test_sort.py
: 注册
heap_sort
到测试列表,添加算法元数据
main.py
: 添加 Heap Sort 演示
README.md
: 更新算法表格,添加 Heap Sort 行
技术细节
堆排序是一种高效的比较排序算法:
时间复杂度: O(n log n) (所有情况)
空间复杂度: O(1) (原地排序)
不稳定排序
测试结果
✅
50 tests passed (包括 heap_sort 的所有测试用例)
关联 Issue
Closes
#28
Merge request reports