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

Create all_possible_subsequences.js #1524

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

100mya
Copy link

@100mya 100mya commented Oct 13, 2023

javascript code for all possible subsequences using backtracking

Copy link
Collaborator

@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.

Side effects (console.log) are a poor API for this. Ideally this should be a generator for much better reusability and testability. A callback or pushing to an array may also be acceptable (though I'd prefer the generator).

Needs proper tests rather than an example in the file.

Also seems to be partially redundant with Recursive/SubsequenceRecursive.js, which solves a more specific problem (strings, only nonempty subsequences). Ideally SubsequenceRecursive.js should be rewritten in terms of this.

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.

None yet

2 participants