Recursive Factorial Function

preview_player
Показать описание
Introduction to recursion.
Рекомендации по теме
Комментарии
Автор

The only video that properly explains recursion in Python on Youtube...

Dan-tfkb
Автор

Years ago I had been out of school for 15 years and Sol helped me test into college algebra. I just stumbled upon this while I was scratching my head trying to follow recursion in the Python course I'm taking and thought, "That sounds like Sol" sure enough, I saw the Khan academy logo. I was like "I bet he is going to explain this perfectly" and in < 1 min it clicked. I didn't know he taught this too. Subscribed!

justinv
Автор

THANK U I SWEAR I LOVE MY CS PROFESSOR BUT I WAS SO STUMPED UNTIL THIS

zainabsiddiqui
Автор

BLESS U AND MAY YOUR SOUL GO TO HEAVEN

zainabsiddiqui
Автор

thank you Khan once again you have saved me :) you'r a true Genius

ndmarich
Автор

Dude you saved my ass
thanks heaps, I watched some videos, but only yours helped!!!!
Thank you again!

FireVortex
Автор

hey sal great video, but instead of putting if n<=1, u could have just tried if n==0, works just as fine, otherwise thanks for the great video, really helped

xMrPAINTx
Автор

Yay I got so excited that you're finally teaching computer science!

jonwho
Автор

slightly fascinating? dude, that's mind-blowing

TheBancho
Автор

Thanks for the great video. I should warn you though - python has a very shallow stack frame, 1000 frames max. Then it'll be a stack overflow.

computerex
Автор

Sometimes you are correct. Recursion can be written in a way that causes issues where it fills up the stack and causes memory problems. But, you can use a language that takes advantage of things like tail-recursion or write your recursive functions in a smarter way that doesn't cause these problems.

So, it is not just theoretical. Many algorithms can take advantage of recursion to make their implementation incredibly simple. Recursion is just a tool like for/while loops.

TaylorBerger
Автор

khanacademy should hire phpacademy and thenewboston for its programming tutorials. I think if they collaborate it would really be something awesome.

adijo
Автор

Python is the most neutral language he could have chosen as it is not focused around a specific paradigm. It really isn't hard to translate these ideas from one language to another.

Ferrus
Автор

@armpitpuncher thats what i wanted to know, thanks a lot!!!

prpunk
Автор

I can't find these videos on Khan academy website

xx_p
Автор

@m1o2 It's a general rule of thumb to use 4 spaces instead of a tab, dunno exactly why but most Python scripters swear by it.

ForgedEggs
Автор

I think this is his response to thenewboston doing the Geometry tutorials

negomirbo
Автор

Please do with java or c++
thanks man

RiyadhElalami
Автор

u don't have to press 3 spaces. u can press a 1 tab.

MikyLestat
Автор

is this language similar to matlab??? we use matlab in my university

prpunk