Skip to content

Update permutations.py - #8102

Merged
chriso345 merged 11 commits into
TheAlgorithms:masterfrom
sundaram2021:patch-3
May 31, 2023
Merged

Update permutations.py#8102
chriso345 merged 11 commits into
TheAlgorithms:masterfrom
sundaram2021:patch-3

Conversation

@sundaram2021

Copy link
Copy Markdown
Contributor

Earlier in the permutation function it is creating an infinite recursion which is causing an error

instead of that I used backtracking to get the output

*[x] Fixed a bug or typo in an existing algorithm in permutations.py?

Earlier in the permutation function it is creating an infinite recursion which is causing an error instead of that I used backtracking to get the output
@algorithms-keeperalgorithms-keeperBot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Jan 26, 2023

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

Instead of deleting the old code, perhaps create an alternate function using the backtracking method, while keeping the original function.

sundaram2021and others added 2 commits January 26, 2023 13:41
modified permute function which is using recursive methode
to permute2 function which is using backtracking to find the output
@sundaram2021

Copy link
Copy Markdown
ContributorAuthor

I have created a new function named as permute2 with the backtracking method

sundaram2021and others added 2 commits January 26, 2023 13:57
added list module to Permute2 function
@@ -1,7 +1,9 @@
from typing import List

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.

remove from typing import List as it is unused , creating pre-commit error.

chriso345
chriso345 previously requested changes May 17, 2023
Comment threaddata_structures/arrays/permutations.py Outdated
sundaram2021and others added 2 commits May 17, 2023 20:19
@algorithms-keeperalgorithms-keeperBot added the tests are failing Do not merge until tests pass label May 17, 2023
@chriso345
chriso345 dismissed their stale reviewMay 18, 2023 23:38

Completed

@chriso345chriso345 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All the tests need to inline, otherwise they fail.

Comment threaddata_structures/arrays/permutations.py Outdated
@algorithms-keeperalgorithms-keeperBot removed the tests are failing Do not merge until tests pass label May 31, 2023
@chriso345
chriso345 merged commit 4a27b54 into TheAlgorithms:masterMay 31, 2023
@algorithms-keeperalgorithms-keeperBot removed the awaiting reviews This PR is ready to be reviewed label May 31, 2023
@isidroasisidroas mentioned this pull request Jan 25, 2025
14 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementThis PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sundaram2021@CaedenPH@chriso345@rohan472000