ebnkk0ytetany9aR ebnkk0ytetany9aR
  • 08-11-2016
  • Computers and Technology
contestada

Use pseudocode to specify a recursive algorithm to compute the nth value of the harmonic series, for some integer n.

Respuesta :

antonsandiego
antonsandiego antonsandiego
  • 11-11-2016
Well, this task is pretty easy, I bet after my countings you will immediately understand how to figure it out : 
At first, def h(n): 
As it is done, n = 0, so after returning 0
[tex]sum = 1./n + h(n-1)[/tex]
The last thing you should do is to return sum
hope it helps =)

Answer Link

Otras preguntas

Solve equations - two sides (135a) Solve 2x - 7=7x +5
-1<X<1 , A=|x-2|-3|x-1|+|x+3|-2​
Answer now for brainless
Identify the type of macromolecule (carbohydrate, lipid, nucleic acid, protein) that changes when Glu changes to Asp. Explain your answer.
One similarity and one difference between hydrolysis and carbonation.
What challenges did the two-front war present to the Allied effort? What strategy did the United States employ when fighting the Japanese in the Pacific?
Observe your local community and consult friends, family, and local leaders to identify issues in your area. List at least three issues that you would like to s
During lockdown down period people work very puzzled and their decided to play some game firstly they collect the 17 cards and write the numbers 1 to 17 put the
Gerald is trying to gain muscle and needs to consume more protein every day. If he has a protein shake that contains 32 grams and the entire shake is 340 grams,
Can Someone Summarize "The Jewels Of The Shrine" Scene 2