Skip to content

feat: add counting sort with unified bucket/output visualizer#4

Merged
gian-gg merged 1 commit intomainfrom
sort/counting-sort
Mar 7, 2026
Merged

feat: add counting sort with unified bucket/output visualizer#4
gian-gg merged 1 commit intomainfrom
sort/counting-sort

Conversation

@gian-gg
Copy link
Member

@gian-gg gian-gg commented Mar 7, 2026

Description

Adds a complete Counting Sort implementation and visualization flow, including stable output construction using cumulative counts.

Summary of changes:

  • Added counting-sort to the algorithm registry and marked it as implemented.
  • Added route wiring for /algorithms/counting-sort.
  • Implemented CountingSortPage with:
    • counting/frequency phase
    • cumulative bucket phase
    • stable placement phase (right-to-left input traversal)
  • Extended sorting frame types to support multi-layer visualization data:
    • input array
    • buckets
    • output array
  • Upgraded SortingVisualizer to support 3 stacked levels when bucket/output data is present.
  • Added bucket range display in section title (e.g. Buckets (10 to 100)).
  • Added bucket tooltip details with visible index/value/count on hover.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have checked that my commit message follows conventional commits

Preview

counting-sort-preview.mov

@gian-gg gian-gg force-pushed the sort/counting-sort branch from e45ba8e to ff7c26e Compare March 7, 2026 15:28
@gian-gg gian-gg merged commit 0850d73 into main Mar 7, 2026
1 check passed
@gian-gg gian-gg deleted the sort/counting-sort branch March 7, 2026 16:12
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