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

[NEW ALGORITHM] Implement Pigeonhole Principle-Based Sorting Algorithm #1650

Closed
2 tasks done
divyalakshmi0 opened this issue Nov 4, 2024 · 1 comment
Closed
2 tasks done
Labels

Comments

@divyalakshmi0
Copy link
Contributor

divyalakshmi0 commented Nov 4, 2024

Issue Title: Implement Pigeonhole Principle-Based Sorting Algorithm

Description:
This task involves implementing a sorting algorithm based on the pigeonhole principle, an often-overlooked but powerful concept in combinatorics. The pigeonhole principle asserts that if there are more items than containers, at least one container must hold multiple items. In sorting, this principle is applied by mapping values to unique "pigeonholes" (or bins) based on their range or specific properties, making it highly efficient for certain types of data.

The Pigeonhole Sorting algorithm is most suitable for datasets where values lie within a small, fixed range, allowing each value to be directly placed into an array bucket, which makes it faster than comparison-based sorts like quicksort or mergesort for constrained ranges.

What It Will Do:
The implementation will involve:

  1. Identifying the minimum and maximum values in the dataset to determine the range.
  2. Creating a set of "pigeonholes" (bins) based on this range.
  3. Iteratively placing each item in the dataset into its corresponding pigeonhole.
  4. Retrieving items in sorted order by reading from the pigeonholes.

Benefits:
This algorithm is efficient for integer-based sorting with a constrained range and will provide a unique solution for handling data in specific scenarios, such as preparing data for radix sort or simplifying histogram-like problems. Implementing this algorithm will also introduce users to the pigeonhole principle, a useful concept in both combinatorics and computer science.

Labels:

new algorithm, gssoc-ext, hacktoberfest, level1


Assignees:

  • Contributor in GSSoC-ext
  • Want to work on it
@pankaj-bind pankaj-bind added the duplicate This issue or pull request already exists label Nov 4, 2024
@pankaj-bind
Copy link
Collaborator

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

No branches or pull requests

2 participants