Skip to content

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

Merged
raklaptudirm merged 4 commits into
TheAlgorithms:masterfrom
nebarf:backtracking
Aug 29, 2023
Merged

feat(backtracking): all combinations of k numbers out of 1...n#148
raklaptudirm merged 4 commits into
TheAlgorithms:masterfrom
nebarf:backtracking

Conversation

@nebarf

@nebarf nebarf commented Aug 17, 2023

Copy link
Copy Markdown
Contributor

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

Comment thread backtracking/all-combinations-of-size-k.ts Outdated

@appgurueu appgurueu left a comment

Copy link
Copy Markdown
Contributor

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

nebarf commented Aug 18, 2023

Copy link
Copy Markdown
Contributor Author

@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
Comment thread backtracking/all-combinations-of-size-k.ts Outdated
@nebarf nebarf requested a review from appgurueu August 20, 2023 15:59
@raklaptudirm raklaptudirm merged commit 5f5352d into TheAlgorithms:master Aug 29, 2023
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