upsidedown

dsc assign

Aug 19th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Assignment I
  2. Q.1 Explain Recursion.
  3. Q.2 Write a program using iterative algorithm to find factorial of a number.
  4. Q.3 Write a program using recursive algorithm to find factorial of a number.
  5. Q.4 Recursive definition
  6. a * b = a if b == 1
  7. a * b = a * (b – 1) + a if b> 1
  8.  
  9. Ex. 6 * 3 = 6 * 2 + 6
  10. = 6 * 1 + 6
  11. = 6 + 6 + 6 = 18
  12. Convert the above definition into an algorithm
  13. Q.5 Write a program using recursive algorithm to find Fibonacci series of n terms.
  14. Q.6 Write a short note on Efficiency of Recursion.
Advertisement
Add Comment
Please, Sign In to add comment