How uitxwoodynguyen/sorting-algo-analyzing works
This is a C++ sorting-algorithm analysis project: users can sort data, generate test datasets, run known-answer tests and benchmarks, and inspect runtime charts and tables. The principal workflow is CLI input through shared format handling and algorithm dispatch to a selected sorter, then sorted output. Separate branches cover dataset generation, validation, benchmarking, and plotting; the GUI launches the CLI. The README documents several links not shown in source excerpts, so those are cited to the README; unsampled implementation details are not inferred.
Main entry points: sort_common.hpp Format and dispatch · bench.cpp Benchmark runner · main.cpp CLI entry · kat.cpp Known-answer tests
Components 19
User interfaces
- Desktop GUI
gui/sortapp_gui.py - CLI entry
src/main.cpp
Sorting runtime
- Format and dispatch
src/sort_common.hpp - Insertion sort
src/insertion-sort.cpp - Selection sort
src/selection-sort.cpp - Heap sort
src/heap-sort.cpp - Merge sort
src/merge-sort.cpp - Quick sort
src/quick-sort.cpp - Step walkthroughs
src/sort-step-by-step.cpp
Testing and benchmarks
- Known-answer tests
src/kat.cpp - Test vectors
test-vector/vectors.json - Benchmark runner
src/bench.cpp
Data and analysis
- Dataset generator
dataset/generator.cpp - Input datasets
dataset/input - Expected outputs
dataset/output - Runtime records
Output/benchmark.csv - Charts and tables
scripts/plot_bench.py - Analysis outputs
Output
Other components
- User
Connections 23
- User → CLI entry: runs
README.md - User → Desktop GUI: uses
README.md - Desktop GUI → CLI entry: launches
README.md - CLI entry → Format and dispatch: reads and sorts
src/main.cpp - Format and dispatch → Insertion sort: dispatches
src/sort_common.hpp - Format and dispatch → Selection sort: dispatches
src/sort_common.hpp - Format and dispatch → Heap sort: dispatches
src/sort_common.hpp - Format and dispatch → Merge sort: dispatches
src/sort_common.hpp - Format and dispatch → Quick sort: dispatches
src/sort_common.hpp - User → Dataset generator: generates data
README.md - Dataset generator → Input datasets: writes inputs
README.md - Dataset generator → Expected outputs: writes expected
README.md - CLI entry → Benchmark runner: delegates benchmark
src/main.cpp - Benchmark runner → Input datasets: reads cases
README.md - Benchmark runner → Expected outputs: checks results
README.md - Benchmark runner → Format and dispatch: runs algorithms
README.md - Benchmark runner → Runtime records: writes timings
README.md - CLI entry → Known-answer tests: delegates tests
src/main.cpp - Known-answer tests → Format and dispatch: runs sorts
src/kat.cpp - Known-answer tests → Test vectors: loads cases
README.md - User → Charts and tables: creates reports
README.md - Charts and tables → Runtime records: reads timings
README.md - Charts and tables → Analysis outputs: writes charts and tables
README.md