Home / MCQ Bank / Computer
Computer Dynamic Programming In Data Structures

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.

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • prevFib = curFib curFib = nextFib

Related Computer Questions

What will be the worst case time complexity of code to find sum in given query range (l,r) in an array of size n with q number of such queries? What is the result of 'not True' ? What does the #ifndef directive do in C preprocessing? What is the average case time complexity of binary insertion sort? How can you create a Python package?