Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Assignment I
- Q.1 Explain Recursion.
- Q.2 Write a program using iterative algorithm to find factorial of a number.
- Q.3 Write a program using recursive algorithm to find factorial of a number.
- Q.4 Recursive definition
- a * b = a if b == 1
- a * b = a * (b – 1) + a if b> 1
- Ex. 6 * 3 = 6 * 2 + 6
- = 6 * 1 + 6
- = 6 + 6 + 6 = 18
- Convert the above definition into an algorithm
- Q.5 Write a program using recursive algorithm to find Fibonacci series of n terms.
- Q.6 Write a short note on Efficiency of Recursion.
Advertisement
Add Comment
Please, Sign In to add comment