CoolFace
Apppublic

TOMCHENP/mergeSort_visualizer

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
App README

Merge Sort Visualization App

Demo Video

πŸŽ₯ Click below to watch the demo video:

➑️ Watch Video on Google Drive


Problem Breakdown & Computational Thinking

1. Decomposition

  • β€”Recursively split the input array into two halves.
  • β€”Identify the base case (single-element segment).
  • β€”Merge two sorted halves back into one sorted array.
  • β€”Record each meaningful operation as a visualization step.

2. Pattern Recognition

  • β€”Merge Sort repeatedly uses the same two patterns:
  • β€”Divide: keep splitting the array in half.
  • β€”Conquer: compare the first elements of two sorted lists.
  • β€”Merging always follows the β€œtake the smaller element first” pattern.

3. Abstraction

  • β€”The algorithm hides memory operations and recursion stack details.
  • β€”Instead, it presents simplified, color-coded visual steps.
  • β€”Users only interact with clean inputs and outputs.

4. Algorithm Design

  • β€”Input: comma-separated integers (e.g., 8, 3, 7, 1, 6, 2, 5, 4)
  • β€”Processing: generate annotated Merge Sort steps (splitting + merging)
  • β€”Output: interactive Gradio visualization with slider control
  • β€”Includes input validation and error messaging.

Steps to Run

Run Locally

  1. 1.Install dependencies: pip install -r requirements.txt
  1. 1.Run the app: python app.py
  1. 1.Open the local Gradio link (e.g., http://localhost:7860)

Run on HuggingFace Spaces

  1. 1.Upload these files:
  2. 2.app.py
  3. 3.requirements.txt
  4. 4.README.md
  5. 5.HuggingFace automatically builds and deploys the Gradio app.

Hugging Face Link

https://huggingface.co/spaces/TOMCHENP/mergeSort_visualizer


Author & Acknowledgment

Author: Tom Chen Course: CISC-121 β€”Fall 2025 Acknowledgments:

  • β€”CISC-121 project guidelines
  • β€”Gradio library for interface
  • β€”Merge Sort algorithm reference from Introduction to Algorithms (Cormen et al.)

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference