adplus-dvertising
frame-decoration

Question

The following sequence is a fibonacci sequence:
0, 1, 1, 2, 3, 5, 8, 13, 21,…..

Which technique can be used to get the nth fibonacci term?

a.

Recursion

b.

Dynamic programming

c.

A single for loop

d.

All of the mentioned

Answer: (d).All of the mentioned

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. The following sequence is a fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21,….. Which technique can be used to get the nth fibonacci term?

Similar Questions

Discover Related MCQs

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

Q. Suppose we find the 8th term using the recursive implementation. The arguments passed to the function calls will be as follows:

fibonacci(8)

fibonacci(7) + fibonacci(6)

fibonacci(6) + fibonacci(5) + fibonacci(5) + fibonacci(4)

fibonacci(5) + fibonacci(4) + fibonacci(4) + fibonacci(3) + fibonacci(4) + fibonacci(3) + fibonacci(3) + fibonacci(2)

:

:

:

Which property is shown by the above function calls?

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

Q. You are given infinite coins of 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. This problem can be solved using ____________

Q. Suppose you have coins of denominations 1, 3 and 4. You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm NOT produce an optimal answer?

Q. Suppose you have coins of denominations 1,3 and 4. You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm produce an optimal answer?

Q. 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?

Q. Suppose 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 space complexity of a dynamic programming implementation used to solve the coin change problem?

Q. You are given infinite coins of denominations 1, 3, 4. What is the total number of ways in which a sum of 7 can be achieved using these coins if the order of the coins is not important?

Q. You are given infinite coins of denominations 1, 3, 4. What is the minimum number of coins required to achieve a sum of 7?

Q. You are given infinite coins of denominations 5, 7, 9. Which of the following sum CANNOT be achieved using these coins?

Q. You are given infinite coins of denominations 3, 5, 7. Which of the following sum CAN be achieved using these coins?

Q. Given a one-dimensional array of integers, you have to find a sub-array with maximum sum. This is the maximum sub-array sum problem. Which of these methods can be used to solve the problem?

Q. Find the maximum sub-array sum for the given elements.
{2, -1, 3, -4, 1, -2, -1, 5, -4}

Q. Find the maximum sub-array sum for the given elements.
{-2, -1, -3, -4, -1, -2, -1, -5, -4}

Q. What is the time complexity of the naive method used to find the maximum sub-array sum in an array containing n elements?

Q. What is the space complexity of the naive method used to find the maximum sub-array sum in an array containing n elements?

Q. What is the time complexity of the divide and conquer algorithm used to find the maximum sub-array sum?

Q. What is the space complexity of the divide and conquer algorithm used to find the maximum sub-array sum?

Q. Find the maximum sub-array sum for the following array:
{3, 6, 7, 9, 3, 8}