Question
Consider the following Python code for calculating
Fibonacci numbers using memoization: Â Â memo = {} Â Â def fib_memo(n): Â Â Â Â if nSolution
The fib_memo function will compute and store values for n=0, 1, 2, 3, 4, 5. Â Â - fib_memo(0) returns 0, memo[0] = 0 Â Â - fib_memo(1) returns 1, memo[1] = 1 Â Â - fib_memo(2) calls fib_memo(1) (from memo) and fib_memo(0) (from memo), computes 1, memo[2] = 1 Â Â - fib_memo(3) calls fib_memo(2) (from memo) and fib_memo(1) (from memo), computes 2, memo[3] = 2 Â Â - fib_memo(4) calls fib_memo(3) (from memo) and fib_memo(2) (from memo), computes 3, memo[4] = 3 Â Â - fib_memo(5) calls fib_memo(4) (from memo) and fib_memo(3) (from memo), computes 5, memo[5] = 5 Â Â All values from 0 to 5 will be stored.
Which of the following were part of the "Four Modernizations' in China in 19782
1. Agriculture
2. Industry
3. Science and Technology
4. Democracy
AsofAugust2020,Indiagetsitslargestexportvaluefrom:
In which of the following years was the National Archives of India established?
The ‘Servants of India Society’ was the brainchild of which of the following leaders?
Which is the outermost part of the earth?
The theme for International Mother Earth Day, 2021 was ‘______’.
As of October 2020, who among the following is the youngest Nobel Laureate?
How many teams participated in the Men ’ s 36th Federation Cup volleyball tournament held in Karaikal from April 20 to 26?
Which Committee had suggested a penalty or punishment for the non performance of Fundamental Duties?
Which of the following statements is/are correct in the context of River Brahmaputra?
1. It is known as Tsangpo in Tibet and Yarlung Zangbo in Ch...