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 the 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
- Minimum cuts required to convert a palindromic string to a different palindromic string
- Make palindromic string non-palindromic by rearranging its letters
- Find the count of palindromic sub-string of a string in its sorted form
- Print Longest Palindromic Subsequence
- Check if a string contains a palindromic sub-string of even length
- Find a palindromic string B such that given String A is a subsequense of B
- Print all palindromic paths from top left to bottom right in a matrix
- Lexicographically first palindromic string
- Count palindromic characteristics of a String
- Find all palindromic sub-strings of a given string | Set 2
- Count All Palindromic Subsequence in a given String
- Find all distinct palindromic sub-strings of a given string
- Number of strings of length N with no palindromic sub string
Improved By : ShashwatSingh