Question
PLEASE THE PROGRAM SHOULD BE IN C LANGUAGE!!! NOT C++!! I REPEAT THE PROGRAM SHOULD BE IN C LANGUAGE Generate all palindromic decompositions of a
PLEASE THE PROGRAM SHOULD BE IN C LANGUAGE!!! NOT C++!! I REPEAT THE PROGRAM SHOULD BE IN C LANGUAGE
Generate all palindromic decompositions of a string s (cut it into substrings that are palindromes). For example the string abbccd has 4 palindromic decompositions:
a, b, b, c, c, d,
a, b, b, cc, d,
a, bb, c, c, d,
a, bb, cc, d,
Requirements: In main (or another function that will be called in main), repeatedly read a string from the user, until the user enters -1.
For each of these strings, print the palindromic decomposition (one per line) and after that the total number of decompositions.
The function that generates the decompositions and counts them must be recursive.
The maximum string length is 100.
write the recurrence formula (T(n) = .... and the base case T(...) = ... ) for the recursive function that generates the palindromes as a function of the string length, N
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started