Dynamic Programming | Overlapping Subproblems | Solving Fibonacci | Python

preview_player
Показать описание
Dynamic Programming | Overlapping SubProblems

Description : Solving Fibonacci Using Dynamic Programming

code -

#DynamicProgramming#ProgrammingKnowledge #OverlappingSubproblems #TwoPointersTechnique #FloydWarshall #TopologicalSort #DijkstrasAlgorithm #NumberTheory #Python #Sieve #BitMagic #algorithm #CompetitiveProgramming
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

Short Code :
def fibonacci(n):
if n==1 and n==2:
return 1
a=[None]*(n+1)
a[1]=1
a[2]=1
for i in range(3, n+1):
a[i]=a[i-1]+a[i-2]
return a[n]


n=int(input("Enter nth term : "))
print(fibonacci(n))

codecracker
visit shbcf.ru