Python Intermediate Tutorial #9 - Recursion

preview_player
Показать описание
In today's episode, we are talking about the concept of recursion!

Subscribe and Like for more free content!
Рекомендации по теме
Комментарии
Автор

In this video, I messed up the transitions a little bit! Sorry about that! :D

NeuralNine
Автор

Think you have best tutorials on youtube.

trebestorkoleckando
Автор

I have one doubt. Recursion seems slower, and with the risk of causing a stack overflow. Why would you use it? Is there some example of a convenient way of using recursion? Thanks for your tutorials, you are a very good teacher

gonzatoto
Автор

Time complexity for non-recursive function = n
Time complexity for recursive function = 2^n

shashanksingh
Автор

def fbncc(n):
a, b = 0, 1
for x in range(n):
a, b = b, a+b
return a

def fbncc(n):
a, b = 0, 1
for x in range(n):
a, b = b, a+b
return a

Time to play, "which code works!?"
Without testing, answer below.

Dr.Cosmar
Автор

a, b = b, a+b. I dont get it wouldnt it basically do a = b and then do a + b which essencially is a + a ?

therealchicken