September 18th, 2013, 04:50 PM
Please help me, I need to write a recursive function that accepts two strings one arr and a word, and checks whether the word contained in the string arr, not necessarily in sequence. If the word consist of more than three letters and i <j <k are the indexes of the three characters that appear in the word and in arr the following condition should exist k-j<=2*(j-i). For example arr="do no good", word= "dog" There are two options:
- do no g
- do no g
But only the latter satisfies the condition.
the function returnes the containing length. in this example its 7.
i can use exepet of this function two more recursive help function. i cant use loops or pointers
September 18th, 2013, 07:19 PM
This definitely sounds like a homework question of some sort, and we won't do the problem for you. However, we will help if you are having trouble with something specific about it. What code have you tried so far? Is there a specific issue with this question you're not able to solve?
September 19th, 2013, 03:01 AM
I have a test soon and im solving questions and old exams to Prepare myself. I came across this problem and I have no idea foran algorithm that is suitable...I'm really stuck...