Question: #include #include using namespace std; void print_all_suffix(string s) { int l = s.length(); for(int i = l; i >=0 ; i--) { string ss =

 #include #include using namespace std; void print_all_suffix(string s) { int l

#include

#include

using namespace std;

void print_all_suffix(string s)

{

int l = s.length();

for(int i = l; i >=0 ; i--)

{

string ss = s.substr(i,l);

if(ss.empty())

cout

else

cout

cout

}

}

void recursive_fun(string ss)

{

// recursive_fun()

}

int main()

{

string s;

cout

cin >> s;

cout

print_all_suffix(s);

recursive_fun(s);

}

Test the given code. It generates all possible suffixes from a given string Task 1:(5 points) Modify the print all suffix(string) function to count the total number of suffixes and print the number besides printing the suffixes Task 2:(10 points) Write a recursive function to generate all possible suffixes. Task 3:(5 points): How can you count the total number of suffixes without generating them

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!