filmov
tv
Part2 Fibonacci series using Recursion #coding #career #programming #codinginterview #amazon #dsa

Показать описание
Fibonacci Number is the summation of the two previous numbers. We can use recursion as per the following conditions:
Get the number whose Fibonacci series needs to be calculated.
Recursively iterate from value N to 1:
Base case: If the value called recursively is less than 1, the return 1 the function.
Recursive call: If the base case is not met, then recursively call for the previous two values as: recursive_function(N - 1) + recursive_function (N - 2);
Return statement: At each recursive call (except the base case), return the recursive function for the previous two values as:
recursive_function(N- 1) + recursive_function(N - 2);
Time Complexity: O(2N) (2 power N)
Auxiliary Space: O(n)
#coding #software #softwaredeveloper #job #faang #google #amazon #development #developer #career #recursion #programming #leetcode #codingquestions #googleinterview #microsoftinterview #softwareengineer #amazonjobs #softwaredevelopment #problemsolving #leetcodequestion #interview #dynamicprogramming #fibonacci #java #javaquestions #dsa #datastructures #algorithm #itsruntym
Get the number whose Fibonacci series needs to be calculated.
Recursively iterate from value N to 1:
Base case: If the value called recursively is less than 1, the return 1 the function.
Recursive call: If the base case is not met, then recursively call for the previous two values as: recursive_function(N - 1) + recursive_function (N - 2);
Return statement: At each recursive call (except the base case), return the recursive function for the previous two values as:
recursive_function(N- 1) + recursive_function(N - 2);
Time Complexity: O(2N) (2 power N)
Auxiliary Space: O(n)
#coding #software #softwaredeveloper #job #faang #google #amazon #development #developer #career #recursion #programming #leetcode #codingquestions #googleinterview #microsoftinterview #softwareengineer #amazonjobs #softwaredevelopment #problemsolving #leetcodequestion #interview #dynamicprogramming #fibonacci #java #javaquestions #dsa #datastructures #algorithm #itsruntym