ferjulyerly7id ferjulyerly7id
  • 12-12-2016
  • Computers and Technology
contestada

Write a recursive, int -valued function, len, that accepts a string and returns the number of characters in the string .

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 21-12-2016
Without knowing the language, it's pretty imposible to write it.  Once you start thinking recursively, it's not a difficult problem.

While you're recursing, pass the string without the first character.
The base case would be a null string which would return 0.
The unwind would just add one and return that.
Answer Link

Otras preguntas

For the given central angle, determine the distance traveled along the unit circle from the point (1, 0). 360 degrees a. 6.28 units clockwise c. 3.14 units cloc
I have tried to answer this every method I can and I can't solve it​
Read the opening lines of Eleanor Roosevelt's speech "The Struggle for Human Rights." I have come this evening to talk with you on one of the greatest issues of
in The Crucible Why does Proctor forbid Mary from returning to court?
Moses was chosen by God to save and lead Israelites into the Promised Land. If you were Moses, what and how will you respond to Him? Why?
why are baseballs harder to pick up tennis balls?
help me please only the 22. (c)
Find the perimeter. Simplify your answer.
Which of these examples would NOT be considered a hypothesis?
My sister TV. (to watch)will watch or is going to watch? ​