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

User Darah
by
6.7k points

1 Answer

2 votes
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

sum = 1./n + h(n-1)
The last thing you should do is to return sum
hope it helps =)

User Esau
by
7.6k points