Recursion | C Programming Tutorial

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

it's hard to find a free C course that deeps dive with C feautures. This is very helpful thanks!

SteezKaytranada
Автор

Thank you for speaking CLEAR English... Thank you for enunciating your words... 90% of programming videos are either in a foreign language, or done by someone with such a heavy accent that doesn't bother themselves to at least TRY to enunciate so as to be understood! Subscribed!

BLACK-AUTUMN-MAGICK
Автор

Very understandable than our teachers' explanation, thanks.

Pearson
Автор

Very well explained I finally understand. The example explanation at 5:29 was the best because most other people skip that and go to the abstract explanation. I just had a hard time understanding how the function would loop through a chain of multiplication. This makes more sense, each function is unpacked into a smaller function until it reaches the base condition.

jackschool
Автор

Great explanation. Although I'd really love to see a video on recursion that ISN'T about factorials. 🙃

freelance-writer
Автор

i can't measure if the memory increases, but it works when making factorial function static.
Done this before and "31" is the biggest number you can do even when making all the variables of type: long.
QT compiler doesn't allow the last line in the factorial function, return + code.

AnalogDude_
Автор

nice explanation. but what are does issues? i just tested n=100 with this function, and the computer i think lost itself:)
it would be great if you could explain more about this function. well I am amateur but others say this function is so useful, just wanna find out more about this one at least. thanks for your efforts:).

mostafamoradi
Автор

Another thing to note is that, in recursion, variables are strictly local to the function, and there are no need to use loop and change the state of the variables. With iterative approach, we need to keep on changing the state of the variables, which becomes very tough to manage.

However, recursive programs can be cumbersome, if the algorithm has exponential time complexity.

lradhakrishnarao
Автор

wouldnt the break case have to be if (n == 0) return 1
Because 0! = 1

dubstepbanane
Автор

Sir could you explain how the Return statement work's why the function did not return just 1 because when the n ==1 it returns 1 and exit's the function.But it return's all function call values.

goktugparlak
Автор

Sometimes I get an error, "all paths through this function will call itself" and when I don't get that error, the program runs on an infinite loop. Any comments?

qneqne
Автор

sir but what means if(n == 1) return 1;
Why 1? and not 0;

mongraal
Автор

Recursion: the most overrated wet dream of computer science academics.

In practice, it's almost always better in terms of performance, resources, readability and maintainability to use iterative methods.

nezbrun