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

3*(-1*p)=3*(-p) property
Use the number 751,486
What Does 6 Triple Threat Mean In Math
A train travels 42 kilometers in 15 minutes. How far will the train travel in 3 hours at that speed? A. 168 km B. 336 km C. 504 km D. 672 km
which of the following best shows how a historian would study the historiography of the french revolution
Why is the nervous system important
How to factorise 3-3x-36^2 ??
Which of the following is an example of narration? first-person "Two Kinds" Amy Tan Suyuan Woo
Charges $5 entree fee and $2 per hour
talia is working on a monthly budget her monthly income is $500 she has allocated $200 for saving $100 for vehicle expenses and $75 for clothing how much is ava