- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- Which of the following recursive formula...

Q. |
## Which of the following recursive formula can be used to find the factorial of a number? |

A. | fact(n) = n * fact(n) |

B. | fact(n) = n * fact(n+1) |

C. | fact(n) = n * fact(n-1) |

D. | fact(n) = n * fact(1) |

Answer» C. fact(n) = n * fact(n-1) | |

Explanation: fact(n) = n * fact(n – 1) can be used to find the factorial of a number. |

View all MCQs in:
Design and Analysis of Algorithms

- How many recursive calls are there in Recursive matrix multiplication by Strassen’s Method?
- In general, which of the following methods isn’t used to find the factorial of a number?
- Recursive approach to find power of a number is preferred over iterative approach.
- What is the time complexity of the recursive implementation used to find the nth fibonacci term?
- What is the space complexity of the recursive implementation used to find the nth fibonacci term?
- What is the number of swaps required to sort the array arr={5,3,2,4,1} using recursive selection sort?
- What is the advantage of iterative code for finding power of number over recursive code?
- You are given n dice each having f faces. You have to find the number of ways in which a sum of S can be achieved. This is the dice throw problem. Which of the following methods can be used to solve the dice throw problem?
- What is the time complexity of the above recursive implementation used to reverse a string?
- Recursive program to raise an integer x to power y uses which of the following algorithm?

Login to Continue

It will take less than 2 minutes

Report MCQ