[Sorting] Highlight comparisons, add more algorithms, and offer a web (WASM) version

Open
#406 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp, wasm, web-dev

Research direction

Start with Sorting_algorithms_Visualization/src/algorithms.cpp lines 52–63 and Sorting_algorithms_Visualization/src/visualization.cpp lines 206–224 to understand the current sort and drawing paths. The request spans comparison highlighting, several algorithms, BubbleSort behavior, and a browser demo, with Qt for WebAssembly or JavaScript/Canvas suggested as options. Done means comparisons are highlighted, at least three algorithms are added, and the docs page embeds a live demo.

Written by the indexing model from the issue text.

Description

area: sorting priority: P3 size: L type: enhancement

Summary

Only swaps are animated; the compared pair is never highlighted, so algorithms whose work is mostly comparisons (Bubble sort's 9900 compares vs 2439 swaps for n=100) look misleadingly fast. The plain BubbleSort() also lacks the standard shrinking pass/early exit, doing twice the comparisons of Recursive Bubble Sort. Common teaching algorithms (insertion, selection, merge, shell, radix) are missing. A browser build could replace the 36 MB of GIFs on the docs site.

Location

  • Sorting_algorithms_Visualization/src/algorithms.cpp:52-63
  • Sorting_algorithms_Visualization/src/visualization.cpp:206-224

Evidence

Probe counts for 100 elements: Bubble accesses=9900, Recursive Bubble accesses=4950 (same algorithm family, 2x difference from the missing j < amount-1-i bound).

Expected

Richer, more honest visualisation and a live demo on the docs site.

Proposed fix

Colour compared bars, add insertion/selection/merge/shell/radix/counting sorts, add the j < n-1-i bound plus early exit to BubbleSort (or label it "naive"), add a seed field, and build with Qt for WebAssembly (or port the drawing to a small JS/Canvas page) for docs/public/demos/sorting/.

Acceptance criteria

  • Compared elements are highlighted
  • At least three new algorithms
  • Docs page embeds a live demo instead of GIFs

Repository audit, November 2026 · Phase 9 · New features · evidence: found by code reading · ref core-cpp-057


Generated by Claude Code

Dominant language
C++
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ibra-kdbra/Math-Problems

All issues in ibra-kdbra/Math-Problems

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.