Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create flash_sort.cpp #2842

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AkshatPandey2006
Copy link

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.

adding the flash sort algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant