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

What was a strength enjoyed by General George Washington at the start of the war? A. Large numbers of troops B. Large numbers of weapons C. Large amounts of foo
Show the work please
En el calendario hay muchos ____________________. Días de Fiestas Día de la Independencia Dia de Acción de Gracias Día de la Madre
What were the major ideas of Luther's Ninety-Five Theses and why did they have such a strong appeal in Germany?
predict the reactivity of trypsin, in terms of percent maximum activity, at pH 14.
Which complex number has a distance of 17 from the origin on the complex plane? 2 + 15 17 + i 20-31 04-i
How many types of residential circuits are There A. 4 B. 3 C. 5 D. 7
7x7^5pls help me....​
Which of these numbers is closest to 400? 308 391 411 425
Pleasseee help!! With number 4 and 5