REKURSİF FONKSİYONLAR
Python
Rekursif(özyinelemeli) Fonksiyonlar Rekursif Fonksiyonlar , Fonksiyonların Kendi İçinde Tekrar Çağırılmasıdır Örnek f(x)=f(x-1)+x f(1)=1 f(5) Ne Olur f(5)=f
Rekursif(özyinelemeli) Fonksiyonlar
Rekursif Fonksiyonlar , Fonksiyonların Kendi İçinde Tekrar Çağırılmasıdır
Örnek
f(x)=f(x-1)+x f(1)=1
f(5) Ne Olur
f(5)=f(4)+5
f(4)=f(3)+4
f(3)=f(2)+3
f(2)=f(1)+2
f(1)=1
Ne Olur
f(2)=1+2=3
f(3)=3+3=6
f(4)=6+4=10
f(5)=10+5=15
f(5)=15 Olur
Örnek
f(x)=f(x-1)x f(3)=6
f(5) kaç Olur
f(5)=f(4)*5
f(4)=f(3)*4
f(3)=6
Geriye Doğru Gidelim
f(4)=6*4=24
f(5)=24*5=120
f(5)=120 Oldu
Fark Eden Oldumu Bilmem Faktoriyel Fonksiyonu Yazdık
Share Your Expertise, Earn Rewards!
Found this insightful? Imagine your knowledge generating income. Contribute your articles to bylge.com and connect with readers while unlocking your earning potential.