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

Print all palindromic partitions of a string - Backtracking Algorithm in Java #1331

Closed
dhrupad17 opened this issue Jun 16, 2023 · 1 comment

Comments

@dhrupad17
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Here a String is given in Input We have to perform partitioning on the string in such a way that every part is a palindromic string itself and then we will return those parts

Describe the solution you'd like

Here through Backtracking we can recursively try over each and every partitions of the string thus Time Complexity becomes O(2*n).

Describe alternatives you've considered

Alternatively this above problem can be solved through Dynamic Programming Approach too where the time complexity will reduce to O(n^2)

Additional context
Understanding with an example

Input

bcc

Output

All Possible palindromic partitions of a string :
[[b,c,c],[b,cc]]

Copy link

github-actions bot commented May 8, 2024

Stale issue message

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

1 participant