Skip to content

NareIsaghulyan/sorting-algorithms-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorting Algorithms

This project implements and benchmarks multiple sorting algorithms in C++. It allows the user to generate arrays of different sizes and types (random, sorted, reversed), choose a sorting algorithm, and see detailed results including the original array, the sorted array, execution time, and swap count.

Project Structure

  • sorting.h / sorting.cpp - Declaration and Implementation of 6 sorting algorithms
  • helperfuncs.h / helperfuncs.cpp - Swap, Print Array, Generate Array, Benchmark
  • main.cpp - User Interface (algorithm and array selection, displaying results)

Implemented Algorithms

  • Bubble Sort
  • Insertion Sort
  • Selection Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort

What I learned

While building this project I learned:

  • How to implement and compare multiple sorting algorithms in C++
  • How to use the library to measure execution time accurately

Future Improvements

  • Convert sorting algorithms and helper functions into C++ templates to support multiple data types
  • Add more sorting algorithms
  • Improve user interface

About

Implementation and analysis of classic sorting algorithms in C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published