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

feat(backtracking): all combinations of k numbers out of 1...n #148

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

nebarf
Copy link
Contributor

@nebarf nebarf commented Aug 17, 2023

Create all combinations of k numbers out of 1...n using backtracking

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining what this does: This generates an array of sub"sets" (represented by ascendingly sorted subarrays) of size k out of n+1 numbers from 1 to n.

Could you explain why this is backtracking? A standard definition of backtracking contains

[...] removing those solutions that fail to satisfy the constraints of the problem at any point in time [...]

which I don't really see here; I'd simply call this algorithm recursive.

@nebarf
Copy link
Contributor Author

nebarf commented Aug 18, 2023

@appgurueu Thanks for the review! Let me know if comments are clear enough

@nebarf nebarf requested a review from appgurueu August 18, 2023 09:53
@nebarf nebarf requested a review from appgurueu August 20, 2023 15:59
@raklaptudirm raklaptudirm merged commit 5f5352d into TheAlgorithms:master Aug 29, 2023
2 checks passed
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.

3 participants