Question: Please use C++ to code and follow the comment: Exercise P10.6. Use recursion to implement a function int index_of (string s, string t) that returns

Please use C++ to code and follow the comment:

Please use C++ to code and follow the comment: Exercise P10.6. Userecursion to implement a function int index_of (string s, string t) that

Exercise P10.6. Use recursion to implement a function int index_of (string s, string t) that returns the starting position of the first substring of the string s that matches t. Return-1 if t is not a substring of s. For example, int n - s.index_of("Mississippi!", "sip"); // Returns 6 Hint: This is a bit trickier than Exercise P10.5, because you need to keep track of how far the match is from the beginning of the sentence. Make that value a parame- ter of a helper function. S1

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!