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.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Print all palindromic partitions of a string
- Print the longest palindromic prefix of a given 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
- Longest palindromic string formed by concatenation of prefix and suffix of a string
- Find the count of palindromic sub-string of a string in its sorted form
- Print Longest Palindromic Subsequence
- Print Palindromic Paths of Binary tree
- Print all Palindromic Levels Of a Binary Tree
- 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 all palindromic paths from top left to bottom right in a matrix
- Make a palindromic string from given string
- Lexicographically first palindromic string
- Count All Palindromic Subsequence in a given String
- Count palindromic characteristics of a String
- Find all palindromic sub-strings of a given string | Set 2
- Number of strings of length N with no palindromic sub string
- Find all distinct palindromic sub-strings of a given string