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

Three more than the product of two and a number x
Which scientist was responsible for disproving the theory of spontaneous generation? a. Matthias Schleiden b. Theodor Schwann c. Rudolf Virchow d. Louis Pas
Choose the best definition for the following term: factor 1) one of two or more numbers, algebraic expressions, or the like, that when multiplied together produ
URGENTLY ANSWER, RIGHT TRIANGLE TRIGNOMETRY
What will it cost to tile a rectangular floor measuring 299 feet by 34 feet if the tile costs $11 per square foot?
ALMOST DONE!!!! HELP ME!!!!
Urgent help needed w/ right triangle trig
If anyone knows this I need help!!! Please
What is a good reason for a defendant to settle from a court case?
is it's an isosceles trapezoid? how do you know???