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

131 is what percent 2,400,000?
(3x + 2) (2x - 5) = ax² + kx + n . What is the value of a - n + k ?
Karen is 6 years older than Michelle and Michelle is 2 years younger then their brother. The sum of their ages is 62 how old is michelle
which are the numbers that are common multiples of 6 and 8.12 18 24 30 40 48
State the law of universal gravitation, and use examples to explain how changes in mass and changes in distance affect gravitational force.
Solve the following by substitution : -x + y = 10x - y = 5
Can someone tell me the menstrual cycle :)
A jet travels 3950 miles from Chicago to London and then returns. The total flying time for the roundtrip is 16.5 hours. The return trip takes longer due to the
the energy is water but i wanf to know how does it affect the enviorment?
Ammonia is released from dead plants by (A) denitrifying bacteria. (B) nitrogen-fixing bacteria. (C) bacteria of decay. (D) nitrifying bacteria. (E) none of the