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

[FEATURE REQUEST]: Add Shuffling Algorithm #5635

Open
Taranpreet10451 opened this issue Oct 8, 2024 · 3 comments
Open

[FEATURE REQUEST]: Add Shuffling Algorithm #5635

Taranpreet10451 opened this issue Oct 8, 2024 · 3 comments
Assignees

Comments

@Taranpreet10451
Copy link

What would you like to Propose?

I propose to implement a shuffling algorithm that randomizes the order of elements in a list, effectively destroying any existing order. This algorithm will ensure that all possible permutations of the list are equally likely, assuming a fair source of randomness.

Issue details

Implementation:

  1. Develop a function that accepts a list and returns a shuffled version.
  2. Ensure uniform distribution of permutations by leveraging a reliable randomization method.

Additional Information

No response

@Taranpreet10451
Copy link
Author

@siriak Please assign this issue to me.

@Vasto-Lorde999
Copy link

Add Shuffling Algorithm

What Would you like to Propose?
I would like to propose the addition of the Shuffling Algorithm (such as Fisher-Yates) to the repository. This algorithm would be useful for providing a randomized order of the elements in a given list, ensuring randomness. Implementing this in Java would prove to be a useful addition to the existing repository.

Issue Details
The Shuffling Algorithm works by randomizing elements in a list, effectively destroying any previous orders and making every possible order of elements equal in likelihood to one another. The Fisher-Yates algorithm has a time complexity of O(n) and space complexity of O(1).

Additional Information
The proposed implementation will be using the Fisher-Yates Algorithm in order to shuffle finite sequences and order elements by picking them from a list one by one until there are none left, therefore creating unbiased permutations where each possible combination is as likely as another.

[FEATURE REQUEST]: Add Shuffling Algorithm #5635

@Taranpreet10451
Copy link
Author

@siriak
Sorry for the late response.
Thanks for assigning this to me I am on it.

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

No branches or pull requests

2 participants