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

Bias automatically makes an article useless. True False
Which of these would be considered part of the due process of law a) the right to protest b) the right to freedom of speech c) the right to a fair and speedy tr
Anyone know this Solve for Y: 4(y+3)+7=3
if your teacher asks you to choose a reading strategy , what is she asking you to do
What effect did the phrase"self evident" have in the second sentence of the Declaration of Independence
Why does the code mention both civil law and law of nations
The us postal service handles 170000000000 pieces of mail each year. This is 40% of the world's total. How many pieces of mail are sent each year
Find the measure of each angle indicated
is sauce a ou or aw sound
How does an author develop a character in a story