This project benchmarks classic sorting and searching algorithms, profiles the input data, and recommends an algorithm that fits the workload. When results.csv is available, the selector uses those measured winners first and falls back to heuristics otherwise.
- Correct implementations of bubble, insertion, merge, quick, and heap sort.
- Correct implementations of linear, binary, jump, and exponential search.
- An adaptive selector that recommends algorithms from dataset characteristics.
- A CLI for sorting, searching, and benchmark generation.
- A static dashboard in
docs/for presenting benchmark results visually. - Automated tests using the Python standard library.
Run a full benchmark and write the results to results.csv:
python3 __main__.py benchmarkThat command also updates docs/results-data.js, which powers the frontend dashboard.
Sort with automatic algorithm selection:
python3 __main__.py sort --data 5,1,4,2,8Search with automatic algorithm selection:
python3 __main__.py search --data 1,3,5,7,9 --target 7 --assume-sortedSelect a specific algorithm manually:
python3 __main__.py sort --data 5,1,4,2,8 --algorithm merge
python3 __main__.py search --data 1,3,5,7,9 --target 7 --algorithm binary --assume-sortedpython3 -m unittest discover -s tests -vOpen docs/index.html in a browser for a local view, or serve the repository with:
python3 -m http.serverIf you enable GitHub Pages for the docs/ folder on main, the same dashboard will work as a hosted site.
The generated CSV contains:
kind:sortingorsearchingdataset_type: input distributionsize: dataset sizescenario: search scenario or-for sortingalgorithm: algorithm that was timedaverage_time_seconds: average runtime across trialsrecommended_algorithm: selector output for that scenario