GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fetachino/sorting-algorithm-benchmark: C++ benchmark comparing insertion sort, merge sort, and quicksort with measured operations and Gnuplot charts.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
README.md
README.md
 
 
comparisons_plot.gnu
comparisons_plot.gnu
 
 
generate_all_plots.sh
generate_all_plots.sh
 
 
linearscale.png
linearscale.png
 
 
log_comparisons_plot.gnu
log_comparisons_plot.gnu
 
 
log_swaps_plot.gnu
log_swaps_plot.gnu
 
 
log_total_operations_plot.gnu
log_total_operations_plot.gnu
 
 
logscale.png
logscale.png
 
 
main.cpp
main.cpp
 
 
sorting algo.csv
sorting algo.csv
 
 
sorting_results.csv
sorting_results.csv
 
 
swaps_plot.gnu
swaps_plot.gnu
 
 
theoretical_comparison.gnu
theoretical_comparison.gnu
 
 
total_operations_plot.gnu
total_operations_plot.gnu
 
 

Repository files navigation

Sorting Algorithm Benchmark

C++ Gnuplot Benchmark

A C++ benchmark comparing insertion sort, merge sort, and quicksort across increasingly large randomized inputs. The program counts comparisons and swaps, exports results, and supports Gnuplot visualizations on linear and logarithmic scales.

Key finding

At 10,000 elements, insertion sort required roughly 49.8 million measured operations, compared with approximately 254 thousand for merge sort and 253 thousand for quicksort. The experiment makes the practical difference between quadratic and n log n growth visible.

Measured results

Input size Insertion total operations Merge total operations Quick total operations
100 4,518 1,221 1,052
1,000 486,487 18,675 18,488
5,000 12,480,130 117,019 105,933
10,000 49,784,822 254,072 252,819

The measured growth illustrates insertion sort's quadratic behavior and the substantially better scaling of merge sort and quicksort.

Visualizations

Linear-scale comparison

Log-scale comparison

Build and run

g++ -std=c++17 -O2 main.cpp -o sorting-benchmark
./sorting-benchmark

With Gnuplot installed, run generate_all_plots.sh to regenerate the charts.

Testing and verification

The benchmark was verified by compiling with a C++17 compiler and checking that each algorithm produces sorted output for the generated input sizes. The committed sorting_results.csv records the comparison, swap, and total-operation counters used in the charts.

g++ -std=c++17 -O2 -Wall -Wextra main.cpp -o sorting-benchmark
./sorting-benchmark

This is an independent algorithm-analysis portfolio project; no formal course attribution is claimed in the source materials.

Testing and verification

The benchmark was verified by compiling with a C++17 compiler and checking that each algorithm produces sorted output for the generated input sizes. The committed sorting_results.csv records the comparison, swap, and total-operation counters used in the charts.

g++ -std=c++17 -O2 -Wall -Wextra main.cpp -o sorting-benchmark
./sorting-benchmark

This is an independent algorithm-analysis portfolio project; no formal course attribution is claimed in the source materials.

Skills demonstrated

  • C++ algorithm implementation
  • Experimental algorithm analysis
  • Comparisons and swap instrumentation
  • CSV export and Gnuplot visualization
  • Relating measured behavior to Big-O complexity

About the author

Built by Ahmed Balde to connect algorithm theory with measured runtime behavior. See more C++, Python, data, and software-engineering work on GitHub.

About

C++ benchmark comparing insertion sort, merge sort, and quicksort with measured operations and Gnuplot charts.

Topics

algorithmsbenchmarkingcppgnuplotsorting-algorithms

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.