Question: Write a recursive algorithm that determines whether a specified target character is present in a string. It should return true if the target is present

Write a recursive algorithm that determines whether a specified target character is present in a string. It should return true if the target is present and false if it is not. The stopping steps should be

a. a string reference to null or a string of length 0, the result is false

b. the first character in the string is the target, the result is true.

The recursive step would involve searching the rest of the string.

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 Programming Questions!