Skip to content

πŸ’‘ [Feature]: Add Merge Sort VisualizerΒ #1303

Description

@ruhelamahi7-code

❓ Problem Statement

Currently, the project includes Bubble Sort and Quick Sort
visualizers for teaching/demonstrating sorting algorithms.
Merge Sort is another fundamental algorithm that uses a
divide-and-conquer approach, but there's no interactive way
for users to visualize how it works within this project.

πŸš€ Proposed Enhancement

Add a Merge Sort Visualizer project following the same
UI/UX pattern as the existing Bubble Sort and Quick Sort
Visualizers, so users can interactively see how Merge Sort
divides an array into halves and merges them back in sorted
order step by step.

πŸ› οΈ Suggested Implementation

  • Reuse the existing UI structure (input field, speed slider,
    animated bar chart, stats row, result display)
  • Visualize the dividing phase (splitting array into halves)
  • Visualize the merging phase (combining two sorted halves
    back together)
  • Use different colors for: Dividing / Merging / Sorted
  • Track and display comparisons and merge operations count,
    similar to Bubble Sort and Quick Sort Visualizers
  • Add a new file web-app/js/projects/merge-sort.js with:
    • getMergeSortHTML() β€” UI template
    • initMergeSort() β€” sorting logic + animation
  • Register the new project in web-app/js/projects.js:
    • Add to getProjectHTML() map
    • Add to initializers map
  • Add math/Merge-Sort/Merge-Sort.py CLI version following
    the Bubble-Sort.py / Quick-Sort.py pattern
  • Add tests/test_merge_sort.py with unit tests

  • I am a registered GSSoC 2026 contributor.
  • I would like to implement this feature myself.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions