Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago