Skip to content

feat: add Heap Sort algorithm (Phase 6) - #14

Merged
sjamal merged 1 commit into
mainfrom
feature/phase-6-heap-sort
Aug 23, 2026
Merged

feat: add Heap Sort algorithm (Phase 6)#14
sjamal merged 1 commit into
mainfrom
feature/phase-6-heap-sort

Conversation

@sjamal

@sjamal sjamal commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Adds an in-place binary max-heap based Heap Sort, guaranteeing O(n log n) worst-case time with O(1) auxiliary space, exposed through the existing MCP/HTTP service layer as well as src/, with full test coverage and ADR 0018. First Phase 6 item.

- Add src/sorting/heap_sort.py implementing in-place binary max-heap
  construction and repeated root-extraction sorting, guaranteeing
  O(n log n) worst-case time with O(1) auxiliary space.
- Add Heap Sort tests to tests/test_sorting.py covering typical,
  boundary, pre/reverse-sorted, duplicate, and non-mutation scenarios,
  with full coverage.
- Expose Heap Sort via the service layer: sort_heap_sort wrapper in
  service/tools.py, MCP tool, and POST /sorting/heap-sort endpoint,
  each with corresponding tests.
- Add ADR 0018 documenting the binary max-heap design vs. Quicksort
  and Merge Sort trade-offs.
- Update README and ROADMAP; first Phase 6 item.
@sjamal
sjamal merged commit 5429647 into main Aug 23, 2026
1 check passed
@sjamal
sjamal deleted the feature/phase-6-heap-sort branch August 23, 2026 01:39
sjamal added a commit that referenced this pull request Aug 23, 2026
- Add src/sorting/heap_sort.py implementing in-place binary max-heap
  construction and repeated root-extraction sorting, guaranteeing
  O(n log n) worst-case time with O(1) auxiliary space.
- Add Heap Sort tests to tests/test_sorting.py covering typical,
  boundary, pre/reverse-sorted, duplicate, and non-mutation scenarios,
  with full coverage.
- Expose Heap Sort via the service layer: sort_heap_sort wrapper in
  service/tools.py, MCP tool, and POST /sorting/heap-sort endpoint,
  each with corresponding tests.
- Add ADR 0018 documenting the binary max-heap design vs. Quicksort
  and Merge Sort trade-offs.
- Update README and ROADMAP; first Phase 6 item.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant