McqMate

Q. |
## What is the space complexity of the recursive implementation used to find the nth fibonacci term? |

A. | o(1) |

B. | o(n) |

C. | o(n2) |

D. | o(n3) |

Answer» A. o(1) | |

Explanation: the recursive implementation doesn’t store any values and calculates every value from scratch. so, the space complexity is o(1). |

969

0

Do you find this helpful?

3

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- What is the time complexity of the recursive implementation used to find the nth fibonacci term?
- Which of the following recurrence relations can be used to find the nth fibonacci number?
- What is the time complexity of the above recursive implementation used to reverse a string?
- Consider the brute force implementation in which we find all the possible ways of multiplying the given set of n matrices. What is the time complexity of this implementation?
- What is the time complexity of the above recursive implementation of binary search?
- What is the space complexity of the following dynamic programming implementation used to find the minimum number of jumps?
- Consider the brute force implementation of the rod cutting problem in which all the possible cuts are found and the maximum value is calculated. What is the time complexity of this brute force implementation?
- How many recursive calls are there in Recursive matrix multiplication by Strassen’s Method?
- You are given infinite coins of N denominations v1, v2, v3,…..,vn and a sum S. The coin change problem is to find the minimum number of coins required to get the sum S. What is the time complexity of a dynamic programming implementation used to solve the coin change problem?
- Which of the following methods can be used to find the nth Catalan number?