Sorting Algorithms Cpp
Sorting & search algorithm benchmarks
- ★ 1
- stars
- May 2024
- last push
Sorting-Algorithms-Cpp
Overview
Welcome to the Sorting-Algorithms-Cpp repository! This project showcases the implementation of various sorting algorithms in C++. The primary focus is to demonstrate the efficiency and functionality of sorting algorithms such as merge sort, quicksort, heap sort, and counting sort. Each algorithm is meticulously implemented and tested to ensure correctness and performance.
Features
- Merge Sort: A divide-and-conquer sorting algorithm known for its stability and efficient performance.
- Quicksort: A highly efficient sorting algorithm based on the partitioning of the data array.
- Heap Sort: A comparison-based sorting algorithm that uses a binary heap data structure.
- Counting Sort: An integer sorting algorithm that operates by counting the number of occurrences of each distinct element.
Prerequisites
- C++ Compiler: Ensure you have a C++ compiler installed (e.g., GCC).
- Libraries: No external libraries are required.
Installation
- Clone the Repository:
git clone https://github.com/thonos-cpu/Sorting-Algorithms-Cpp.git cd Sorting-Algorithms-Cpp
Compile the Code:
sh
g++ main.cpp -o sorting-algorithms
Run the Program:
sh
./sorting-algorithms
Usage
Select Sorting Algorithm:
The program allows you to choose the sorting algorithm you want to test.
Provide Input:
Enter the input array elements when prompted.
View Results:
The sorted array will be displayed, along with information about the sorting algorithm used and its performance.
Code Structure
main.cpp: Contains the main application logic and user interface.
SortingAlgorithms.h: Header file containing the declarations of sorting functions.
SortingAlgorithms.cpp: Implementation file containing the definitions of sorting functions.
Functions
mergeSort: Implements the merge sort algorithm.
quicksort: Implements the quicksort algorithm.
heapSort: Implements the heap sort algorithm.
countingSort: Implements the counting sort algorithm.
Contributions
Contributions are welcome! Please fork the repository and create a pull request with your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
Special thanks to all contributors and those who provided valuable feedback.
Inspired by the need for efficient sorting algorithms in C++.
For any questions or support, please open an issue in this repository or contact the maintainer at tasisinfo2@gmail.com!
Thank you for your interest in the Sorting-Algorithms-Cpp project!
Feel free to adjust any details as needed for your specific project.