Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Visualizer (sortviz)

This project generates step-by-step sorting visualizations as jgraph files, then converts them to PostScript and PDF.

Supported algorithms:

  • bubble
  • merge
  • quick

Each step is rendered as a row of indexed squares with highlight colors:

  • Yellow: compared indices
  • Pink: value moving from this index
  • Green: value moving to this index

Compilation and demo output

Build and generate demo outputs (PDF + JPG) with one command:

make

This compiles sortviz (if needed), runs several sorting scenarios, and writes showcase files to:

  • tests/demo/*.pdf
  • docs/images/*.jpg

Compile only

make build

Program usage

./sortviz <bubble|merge|quick> <values...>

Examples:

./sortviz bubble 5 1 4 2 8
./sortviz merge 38,27,43,3,9,82,10
./sortviz quick 10 7 8 9 1 5

Each run creates a timestamped folder under tests/bin/ containing one file per step in all formats:

  • step_XXXX.jgr
  • step_XXXX.ps
  • step_XXXX.pdf

Example pictures

Bubble sort

Bubble swap Bubble late pass

Merge sort

Merge mid merge Merge near final

Quick sort

Quick partition Quick pivot settle

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages