SORTIFY: C++ Sorting Algorithm Performance Analysis
A comparative study of Bubble, Selection, Insertion, Merge, Quick, and Counting Sort in C++ with execution time and swap count analysis.
SORTIFY
Sorting Algorithm Analyzer
A Comparative Study of Six Sorting Algorithms in C++
Bhumik Singh Dhami
Kushagra Singhal | Aditya Gupta | Priyanshu Tiwari
github.com/BHUMIKSINGHDHAMI/sorting-analyzer
C++17 • Visual Studio Code • April 2026
SORTIFY
Project Abstract
Choosing the right sorting algorithm isn't just about Big-O — real performance depends on time, memory, and system behavior.
Builds a Sorting Algorithm Analyzer in C++ comparing six algorithms: Bubble, Selection, Insertion, Merge, Quick, and Counting Sort.
Measures execution time using the <chrono> library, along with comparisons and swaps.
Tests different input types: random, sorted, and nearly sorted arrays.
Results displayed in a structured table for easy side-by-side comparison.
Helps identify which sorting algorithm performs best in different real-world situations.
SORTIFY
Meet the Team
Student Project Team — 2026
BD
BHUMIK SINGH DHAMI
TEAM LEAD
dhamibhumiksingh@gmail.com
240221981
KS
KUSHAGRA SINGHAL
DEVELOPER
kushagrasinghal901@gmail.com
24011367
AG
ADITYA GUPTA
DEVELOPER
rakeshgupta01031971@gmail.com
240211443
PT
PRIYANSHU TIWARI
DEVELOPER
priyanshutiwari23102006@gmail.com
240212125
github.com/BHUMIKSINGHDHAMI/sorting-analyzer
SORTIFY
System Architecture
SORTIFY
Project Approach
Step-by-Step Development Methodology
01
Algorithm Selection
Choose 6 sorting algorithms: Bubble, Insertion, Selection, Merge, Quick, Counting Sort
02
Implementation
Write C++ code for each algorithm in a modular architecture
03
Time Measurement
Use C++ <chrono> library to measure execution time in milliseconds
04
Swap Counting
Track number of swaps performed during each sort
05
Testing
Run on small, medium, large, random, nearly sorted datasets
06
Analysis
Compare results for speed, efficiency, and stability
07
Reporting
Present findings using tables, charts, and colored output
SORTIFY
Key Features Implemented
Built with C++17 | Visual Studio Code | Git/GitHub
C++17
<chrono>
STL
<iomanip>
Git/GitHub
6 Sorting Algorithms
With swap counter integration
High-Precision Timing
<chrono> millisecond precision
Multiple Dataset Types
Random, Sorted, Nearly Sorted
Tabular Output
Clean aligned result display using std::setw()
Modular Architecture
Easy to extend and maintain
Color-Coded Terminal
Visual highlighting of best/worst results
github.com/BHUMIKSINGHDHAMI/sorting-analyzer
SORTIFY
Task Distribution
Who built what
1. Project structure and modular architecture design
Bhumik Singh Dhami
2. GitHub repository setup and version control
Kushagra Singhal
3. Data Generator module (random/sorted/nearly sorted)
Bhumik Singh Dhami
4. Timer module using <chrono> library
Kushagra Singhal
5. Bubble Sort implementation with swap counter
Aditya Gupta
6. Selection Sort implementation with swap counter
Priyanshu Tiwari
7. Insertion Sort implementation with swap counter
Aditya Gupta
8. Merge Sort implementation with swap counter
Priyanshu Tiwari
9. Quick Sort implementation with swap counter
Bhumik Singh Dhami
10. Counting Sort implementation with swap counter
Kushagra Singhal
11. Input Handler module
Aditya Gupta
12. Metrics structure definition
Bhumik Singh Dhami
13. Analyzer core logic
Kushagra Singhal
14. Tabular result formatting and output display
Priyanshu Tiwari
15. Terminal color formatting
Kushagra Singhal
SORTIFY
Challenges & Solutions
Key Technical Roadblocks Overcome
Precise Time Measurement
algorithms finish in microseconds on small datasets
Used std::chrono::high_resolution_clock with millisecond precision + warm-up runs
Swap Counting
integrating counters into Merge Sort & Quick Sort without disrupting logic
Passed counter variables by reference through recursive calls, incremented at each swap
Counting Sort for Negatives
initially assumed non-negative integers only
Implemented offset-based indexing to handle negative values in datasets
Large Dataset Memory Overhead
multiple copies of large datasets caused memory issues
Copy-on-test approach — each algorithm receives a fresh copy of original dataset only when needed
Tabular Output Alignment
inconsistent column widths for varying algorithm name lengths
Dynamic column width calculation using std::setw() for formatted output
SORTIFY
Project Outcomes & Deliverables
What the system delivers upon completion
Multi-Algorithm Support
Supports 6 sorting algorithms — Bubble, Selection, Insertion, Merge, Quick, Counting Sort for comprehensive comparison.
Execution Time Analysis
Measures execution time with millisecond precision using C++ <chrono> library.
Swap Count Analysis
Tracks number of swaps performed during sorting to understand internal efficiency.
Multi-Dataset Testing
Tests on random, sorted, and nearly sorted inputs to observe performance under various conditions.
Tabular Result Display
Structured table format for easy side-by-side algorithm comparison with aligned columns.
Color-Coded Output
Terminal color formatting highlights best and worst-performing algorithms for readability.
SORTIFY
Progress Overview
Current Completion Status — April 2026
Planning & Algorithm Selection
Program Structure Design
Algorithm Implementation in C++
Timer & Swap Counter Integration
Multi-Dataset Testing
(Random, Sorted, Nearly Sorted)
Tabular Output Display
Color-Coded Terminal Output
All Sorting Algorithms
Timer Module
Data Generator
Analyzer Core
Tabular Output
Color-Coded Output
github.com/BHUMIKSINGHDHAMI/sorting-analyzer
- sorting-algorithms
- cpp-programming
- algorithm-analysis
- computer-science
- coding-project
- performance-metrics