Question

write a recursive algorithm to find the sum of the first N terms of the series...

write a recursive algorithm to find the sum of the first N terms of the series 1, 1/2, 1/3, ... 1/N
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Algorithm:

An algorithm is a step by step procedure that gives a solution to the problem.

The algorithm to find the sum of the given series is given below:

Step 1: Start

Step 2: Declare variables N

Step 3: Read values N

Step 4: calculateSum(N)

Step 4.1: If N = 1

Step 4.2: return 1

Step 4.3: Else

Step 4.4: return 1/N +  calculateSum(N - 1)

Step 5: Display the return value

Step 6: Stop

Add a comment
Know the answer?
Add Answer to:
write a recursive algorithm to find the sum of the first N terms of the series...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT