Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding the Flash Sort Algorithm
Description of Change
This PR introduces the Flash Sort algorithm under the sorting namespace. Flash Sort is an efficient, distribution-based sorting algorithm that performs exceptionally well on large datasets with uniformly distributed elements. The algorithm partitions the input data into buckets and sorts them locally, leading to better performance compared to traditional sorting algorithms in specific scenarios.
This implementation includes:
Bucket-based distribution of elements based on a linear scaling formula.
Local sorting within each bucket to ensure overall sorted order.
Handling of edge cases, such as arrays with a single element or identical values, ensuring the algorithm works seamlessly for all input sizes.
The implementation also comes with a test suite that verifies the correctness of the algorithm for various data types, including int, float, char, std::string, and std::pair.
Checklist
Added description of change
Added file name matches File name guidelines
Added tests and example, tests must pass
Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
Relevant documentation/comments are added
PR title follows semantic commit guidelines
Searched previous suggestions to avoid duplication
Acknowledge that all contributions are made under the project's license
Notes:
This addition enhances the repository by including an advanced sorting algorithm. Flash Sort offers superior performance in specialized use cases, making it a valuable addition to the collection of sorting techniques.