Make your first Pull Request for Hacktoberfest 2024! Don’t forget to spread the love, and if you find it helpful, consider giving us a ⭐️. This repository includes useful algorithms and code to help beginners, featuring multiple languages and ideas. You’ll also find some beginner-friendly mini projects to get you started!
40
stars
294
forks
source link
Added implementations for Heap Sort and Shell Sort algorithms #177
This pull request implements two sorting algorithms: Heap Sort and Shell Sort, in C++.
Heap Sort:
This implementation utilizes a binary heap data structure to sort an array in ascending order.
The algorithm builds a max heap from the input data, then repeatedly extracts the maximum element to construct the sorted array.
Shell Sort:
This implementation improves upon the insertion sort by allowing the exchange of items that are far apart, leading to faster overall sorting.
It uses a gap sequence to determine which elements to compare and move, progressively reducing the gap until it reaches one.
Both algorithms include clear comments to facilitate understanding of the implementation. These additions enhance the repository by providing efficient sorting methods that can be used for various applications.
This pull request implements two sorting algorithms: Heap Sort and Shell Sort, in C++.
Heap Sort:
Shell Sort:
Both algorithms include clear comments to facilitate understanding of the implementation. These additions enhance the repository by providing efficient sorting methods that can be used for various applications.