Dynamic Programming In Data Structures - Study Mode
[#126] You are given an array of elements where each array element represents the MAXIMUM number of jumps that can be made in the forward direction from that element. You have to find the minimum number of jumps that are required to reach the end of the array. Which of these methods can be used to solve the problem?
Correct Answer
(D) Recursion and Dynamic Programming
[#127] Which of the following is the longest common subsequence between the strings "hbcfgmnapq" and "cbhgrsfnmq" ?
Correct Answer
(D) fgmna
[#128] What is the maximum number of ways in which a boolean expression with n + 1 terms can be parenthesized, such that the output is true?
Correct Answer
(A) nth catalan number
[#129] You are given infinite coins of denominations 1, 3, 4. What is the minimum number of coins required to achieve a sum of 7?
Correct Answer
(B) 2
[#130] Consider the following code to find the nth fibonacci term: int fibo(int n)
if n == 0
return 0
else
prevFib = 0
curFib = 1
for i : 1 to n-1
nextFib = prevFib + curFib
__________
__________
return curFib Complete the above code.
Correct Answer
(C) prevFib = curFib
curFib = nextFib