Given a string, find all possible palindromic partitions of given string.
Note that this problem is different from Palindrome Partitioning Problem, there the task was to find the partitioning with minimum cuts in input string. Here we need to print all possible partitions.
The idea is to go through every substring starting from first character, check if it is palindrome. If yes, then add the substring to solution and recur for remaining part. Below is complete algorithm.
Below is C++ implementation of above idea
n i t i n n iti n nitin
This article is contributed by Ekta Goel. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Print all palindromic partitions of a string
- Print all the palindromic permutations of given string in alphabetic order
- Find the count of palindromic sub-string of a string in its sorted form
- Find a palindromic string B such that given String A is a subsequense of B
- Check if a string contains a palindromic sub-string of even length
- Print Longest Palindromic Subsequence
- Print all palindromic paths from top left to bottom right in a matrix
- Lexicographically first palindromic string
- Find all palindromic sub-strings of a given string | Set 2
- Count All Palindromic Subsequence in a given String
- Count palindromic characteristics of a String
- Number of strings of length N with no palindromic sub string
- Find all distinct palindromic sub-strings of a given string
- Rearrange the string to maximize the number of palindromic substrings
- Minimum number of palindromic subsequences to be removed to empty a binary string