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

Permutation Memory Issues #60

Open
Chadtech opened this issue Jun 14, 2017 · 3 comments
Open

Permutation Memory Issues #60

Chadtech opened this issue Jun 14, 2017 · 3 comments

Comments

@Chadtech
Copy link
Collaborator

Chadtech commented Jun 14, 2017

In the slack channel, Numiastowski discovered that permutations causes a memory problem. A list of 9 elements might have as many as 9! permutations, and therefore, 9! stack calls.

I believe this can be solved by implementing something like this: https://www.nayuki.io/page/next-lexicographical-permutation-algorithm, or any non-recursive permutation function.

But before settling on that, we should consider use cases of the permutation function. Has anyone used it? How did you use it? What problem did it solve for you?

@pzp1997
Copy link
Contributor

pzp1997 commented Jun 14, 2017

Maybe it should be lazy?

@Chadtech
Copy link
Collaborator Author

@zwilias made this cool Ellie app demonstrating an implementation of the next permutation algorithm. Could be useful to this project : https://ellie-app.com/3vnrtbJffbYa1/0

@pzp1997
Copy link
Contributor

pzp1997 commented Jun 23, 2017

We might want to consider the implementation of subsequences as well, which outputs a list of 2n lists for an input list of length n.

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