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

asked
User Darah
by
7.3k 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 =)

answered
User Esau
by
8.4k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.