You managed to explain something that could have been really difficult in a real simple way, all in 8 minutes. You are a true gift.
@joshrandhawa43567 жыл бұрын
He didnt go in depth thats y
@ShohamChakrabortyBatman7 жыл бұрын
y so salty
@alive4metal4537 жыл бұрын
true, but his explanation set the ground really well to allow anyone who is interested in examining the concept further in depth to be able to do so
@shutdahellup694206 жыл бұрын
in 4 min, cuz i watch all the tutorials in 2x speed😂😂😂😂
@abrahamshepher93214 жыл бұрын
seriously so true
@Roshaan375 жыл бұрын
Who knew a video from 8 years ago, when I was in middle school, would help me in college.
@RichardHardwood_4 жыл бұрын
yea, I went over recursion last term. I didn't watch this video when I needed it, but it does a better job of explaining how and why recursion works the way it does than the video my CS162 teacher provided. However that's probably because teachers are forced to teach a certain way unless, they're tenured.
@shakky42324 жыл бұрын
same🤣
@manvideepak82173 жыл бұрын
11 years duh!
@denizkendirci10 жыл бұрын
i perfectly understand how it works. as "a concept" it's easy to grasp... but in practice, i'm not sure that i can come up with my own example to code.
@musicverse94 жыл бұрын
@Jeremiah Givens instead of using if and else if just use condition if (n==0||n==1)return n;
@erikmachado44893 жыл бұрын
Literally me right now I understand the concepts just don't know how to go about the code in my assignment.
@hanzalaashraf56053 жыл бұрын
kzbin.info/www/bejne/nqq1q3uQra98iZI
@jasmeet23653 жыл бұрын
you could try making an exponent power recursive function which takes in base and the power gives you the result
@dillontalia137611 жыл бұрын
Bucky all I gotta say is you're a str8 up boss for explaining c++ with such good analogies and clarity. If you were my teacher I'd probably switch my major from EE to CE. You're my main study guide for finals, thanks for all the help man really appreciated.
@natalien85608 жыл бұрын
I am so sad I only stumbled upon this towards the end of the semester. Thank you so much, you're a lifesaver!
@hussianhani44283 жыл бұрын
Did you graduate I hope you did Im just curious lol
@natalien85603 жыл бұрын
@@hussianhani4428 haha yes
@hussianhani44283 жыл бұрын
@@natalien8560 Thats cool!! How did you find the job? also did his tutorials really help?
@uniikkiz9 жыл бұрын
Adding some couts helped me to understand whats going on: int recursion(int x) { if (x == 1) { cout
@seoulpeterson4328 жыл бұрын
+uniikkiz Lol for some reason I'm getting 5 4 3 2 120 Like, I'm pretty sure that's not what he was talking about. I think I know what he was saying, I just want to know what the program is doing exactly.
@davidcadieux63148 жыл бұрын
+Seoul Peterson did u forget the "return 1; " ?
@seoulpeterson4328 жыл бұрын
Probably, I don't have the code in front of me right now.
@seoulpeterson4328 жыл бұрын
Nope, got the return 1; I was missing cout
@arcanerstudios7 жыл бұрын
if(x==1){ cout
@uditkoolwal35309 жыл бұрын
Hey bucky..doing a great job pal! I'm from India and do appreciate your efforts for making the concepts easy and by keeping it simple and clear, you are helping a lot!
@flow14659 жыл бұрын
+udit koolwal yeah u r right even a person like me can understand this pretty easily
@HermanWillems6 жыл бұрын
Why are there so many Indian people programming. Why not get an art degree or something? Just asking.
@DracoMalfoy-yh3ii6 жыл бұрын
@@HermanWillems art degrees don't contribute to the betterment of humanity and are far from being a part of stem, just saying. No hate to anyone doing what they love
@jas47685 жыл бұрын
@@DracoMalfoy-yh3ii You have no right to say that. You have 0 knowledge of the impact of art on the people of this world. Many designs and ideas are visualised through art. You never know, maybe the greatest inventions of this world were thought of whilst listening to Beethovens Fifth Symphony. Im not an artist, I am an engineering student. You are very ignorant and very wrong.
@sauravsahu62437 жыл бұрын
Hats off to your humorous way of teaching stuff :)
@aamirjariwalla895210 жыл бұрын
Dude, your super duper good when it comes to programming. I just love watching and learning from you. Trust me, I'm doing good at the moment when it comes to programming. Thanks to you. Thanks once again.
@TheBurgdorferi11 жыл бұрын
Better way to understand recursion is just think about Nolans' "Inception"
@Cywesleyradio12 жыл бұрын
I just started programming classes and I have a feeling that I am going to be watching your videos a lot more in the future. Thanks.
@JKAzrael24711 жыл бұрын
Already into this tutorial playlist since yesterday, much more useful and better explained than 9 weeks of a crappy lecturer at University. :)
@MightyMuthuCurious11 жыл бұрын
short and crisp!! the concept of recursion is loud and clear!!!! your method of teaching with fun is good and it has made the session interesting!!!!! keep up the good work,sir!!
@takshyasharma8525 жыл бұрын
He explained it so well Bucky is the man He is doing really challenging things so effortlessly
@anthonyparra95537 жыл бұрын
totally worth watching this 8 minute video instead of reading a whole chapter and listening to an hour long lecture
@jcnouel9 жыл бұрын
Best one I've seen! I was watching your video and I was like "Hey, I'm finally getting it!" And then I saw "Oh, It's TheNewBoston"! Thanks
@firastabai57124 жыл бұрын
this is still relevant 9 years later, ty bucky!
@en.mdk.8 жыл бұрын
I am so thankful for this tutorial cuz' I didn't get it when my professor discussed it but you...you just made me understand it in just 8 min. Amazing
@PoyanPourshian10 жыл бұрын
Thanks for the tutorials today, Bucky! I made it from 1-30. Ill be back tomorrow to wrap it up!
@DjZephy13 жыл бұрын
That was the most fun I've had doing a Bucky tutorial! I set mine up to say "5*4*3*2*1 aka 5! = 120". And had the same format work for whatever number I put! Microsoft here I come.... after several years of more learning.
@silentscopez1364 Жыл бұрын
You just helped me understand this.
@tatiachelidze87897 жыл бұрын
Bucky you explained recursion so well I think I already love it. Thank's buddy you are awesome
@mannyt8148 жыл бұрын
Bucky ... i love your tuts. The names you choose are golden. lol they crack me up.
@tomfebry8 жыл бұрын
To everyone not understanding why the "return 1" statement is not printing 1 instead of 120: Think of the calculation like so: x * (factorialFinder). X starts at '5', then you want to find the number to multiple it by, so you call yourself again 'factorialFinder' to get the number '4', this loops all the way down to 1, so it would end up like x (2) * factorialFinder (1) The x==1 and return is to stop it looping around again, if you took the x==1 return statement out it would still return 1, but then it would keep going into minus figures. Hope that clears things up for people.
@odo43211 жыл бұрын
This was quite easy to understand, probably thanks to the way in which he explained it. From my understanding recursive function is just the ability for a function to call itself. A base point is just a statement to end the continuous cycle of loops. When using to find a number factorial it's just like calling the function again and again until it reaches a base point, than it multiplies it all and returns the final value. At least that's my understanding.
@Vortaw12 жыл бұрын
As soon as it reaches 1, it passes the 1 up 1 level at a time. So using 5 as an example: initially it looks like this... 5 (we'll call this A) 5-1 = 4 (B) 5-1-1 = 3 (C) 5-1-1-1 = 2 (D) 5-1-1-1-1 = 1 (E) STOPPING... A(B(C(D(E)))) = 1+1+1+1+1(1+1+1+1(1+1+1(1+1(1)))) = 120 Basically the 5, 4, 3, and 2 are forgotten, and are replaced by the number of recursions the function made before the end case is reached. So 1 is the end case of 1, and 2 is the end case + 1. 5 is the end case + 4.
@SamGulz11 жыл бұрын
@Sir Bucky : I thank God evry night b4 sleepin dat he sent a guy like you on earth whose tutorials I watch the whole day like routine work.
@detectivespoonan76036 жыл бұрын
4:04 just a note, when you have a "return" in an if statement you don't need to include the else just write your line of code directly. Because if the "if" statement executes the function will return the value and stop running (it won't look at the rest of the code).
@lucianoinso12 жыл бұрын
recurssion is a hell of a resource, you can find sorting algorithms, tree's paths and all sort of stuff that uses recursion.
@TonyTxT4 жыл бұрын
THANKS BUCKY U R DA BEST ! i put a global variable as 0...and then i used it to show how many times the factorialFunction was called...now its a lot easier to understand ..and returning 1 or 0 is same as returning true or false.. just in case if someone does't know using namespace std; #include int total = 0; int factorialFunction(int x){ total++; if(x == 1){ cout
@DanT-iu6oc5 жыл бұрын
WHO WILL WIN? $100,000 college tuition, tenured professors, $200 textbooks....or a 7 minute video from Bucky? He is a gift to Mankind. They should give Nobel Peace Prizes to people like him.
@rockydasha12 жыл бұрын
My College Proff. took 3 lectures to try and explain this to us/me. each lecture an hour and 15 minutes,Didn't understand crap. you took 8:19 minutes to make me a master of recursion xD haha, thanks alot!~
@doougle11 жыл бұрын
You say recursion is hated, but I think its great. It's one of my favorite things about programming.
@vsthewrld60613 жыл бұрын
Thanks you just saved me 2 hours of lecture.
@puffbluesam02110 жыл бұрын
WOW!!! This tutorial will make your life easier than listening to your instructor. Nice one Bucky!!! I'll give you some tuna for that!
@AndyU968 жыл бұрын
It's nothing to hate, seems pretty logical, you tie so many unknowns together, and then, you just equal one of those equations to a value and the rest gets solved in a chain reaction
@mtopangaprimo25562 жыл бұрын
Thank you for the videos. Learning alot for my Software development and programming Modul from you.
@MrSaemichlaus11 жыл бұрын
I made a program that calculated the results of all possible ways how a tic tac toe game could end (it's about 355'000 of 'em). Made it by nesting 9 for loops into each other. Now recursion is a new idea. But I think in my case, my program built with recursion would be easier to understand, but slower at runtime. Interesting stuff :D
@MrSaemichlaus11 жыл бұрын
Well then ... there is the beauty :D Every for loop stands for one move. Every time it iterates, checkForEnd() checks whether the move would end the game and can therefore skip the execution of all lower order for loops. writeResult() prints the outcome into a txt file, either in a checkForEnd() or if the lowest order for loop didn't make a winner. Beauty of math, I'd say :) There's the for loop part. The tabs were removed at pasting, but it actually looks somehow like that: for A for B for C for D d c b a Calculating 15000 possibilities took 12 minutes on my 2.3GHz Processor xD Result was 450KB of these lines: Ooo || 1-2-3-4-5-------- TIE || 1-2-3-4-5-6-7-8-9 xxX || 1-2-3-4-5-6-7---- Enjoy! --- // 1-a for ( int a = 1; a < 10; a++ ){ fC[a] = 'X'; mF[1] = a; fF[a] = false; // 2-b for ( int b = 1; b < 10; b++ ){ if ( fF[b] ){ fC[b] = 'O'; mF[2] = b; fF[b] = false; // 3-c for ( int c = 1; c < 10; c++ ){ if ( fF[c] ){ fC[c] = 'X'; mF[3] = c; fF[c] = false; // 4-d for ( int d = 1; d < 10; d++ ){ if ( fF[d] ){ fC[d] = 'O'; mF[4] = d; fF[d] = false; // 5-e --- Win possible from this move on for ( int e = 1; e < 10; e++ ){ if ( fF[e] ){ fC[e] = 'X'; mF[5] = e; if ( !checkForEnd(5) ){ fF[e] = false; // 6-f for ( int f = 1; f < 10; f++ ){ if ( fF[f] ){ fC[f] = 'O'; mF[6] = f; if ( !checkForEnd(6) ){ fF[f] = false; // 7-g for ( int g = 1; g < 10; g++ ){ if ( fF[g] ){ fC[g] = 'X'; mF[7] = g; if ( !checkForEnd(7) ){ fF[g] = false; // 8-h for ( int h = 1; h < 10; h++ ){ if ( fF[h] ){ fC[h] = 'O'; mF[8] = h; if ( !checkForEnd(8) ){ fF[h] = false; // 9-i for ( int i = 1; i < 10; i++ ){ if ( fF[i] ){ fC[i] = 'X'; mF[9] = i; if ( !checkForEnd(9) ){ writeResult(9, RES_TIE); } i = 10; mF[9] = 0; fC[i] = 'E'; } } // end 9-i fF[h] = true; } mF[8] = 0; fC[h] = 'E'; } } // end 8-h fF[g] = true; } mF[7] = 0; fC[g] = 'E'; } } // end 7-g fF[f] = true; } mF[6] = 0; fC[f] = 'E'; } } // end 6-f fF[e] = true; } mF[5] = 0; fC[e] = 'E'; } } // end 5-e fF[d] = true; mF[4] = 0; fC[d] = 'E'; } } // end 4-d fF[c] = true; mF[3] = 0; fC[c] = 'E'; } } // end 3-c fF[b] = true; mF[2] = 0; fC[b] = 'E'; } } // end 2-b fF[a] = true; mF[1] = 0; fC[a] = 'E'; } // end 1-a
@church77812 жыл бұрын
My Java teacher used to hate me because I always used recursion in all of my programs, even if I didnt need it. I managed to get recursion to occur on my second day of class and did it every day after. Recursion is fun!
@LeonelEBD10 жыл бұрын
thank you bucky, 2 times in a row that you help me
@alina_dial8 жыл бұрын
lol,recursion is really something which i always hates and most of teachers are stupid to explain it well because they themselves don't know that what the heck actually recursion is ,thanks for this awesome video bucky,cheers hun :)
@Patrickjk199412 жыл бұрын
Why would any one hate this ? This is awesome!
@prabuacharya77194 жыл бұрын
Hello World ! Bucky is awesome, believe me . I learnt C++ easily with Bucky's tutorials, thanks a lot Bucky.
@jmercouris12 жыл бұрын
return "gives" back a value; within the return statement he is also calling a function, so before the return value you can "give" back the value, it needs to execute the other function, and so on and so forth until it finally gets to the return 1; which DOES NOT have another function attached and therefore it can finally begin giving back to earlier functions
@blendzeqiri28966 жыл бұрын
Dude this is 8 years old, and this fucking helped me so much.... thank you !!!
@HarryAGeorgiou6 жыл бұрын
hey Bucky, nice videos, short and simple, I know you don't want to confuse beginners, just to let you know that above 12! (12 factorial) the program will not work properly, you get a negative value instead and even after that around 34 you get a 0. maybe in your later tutorials you deal with how to handle large numbers or calculations. I have some experience of programming but just readjusting to C++ using visual studio and this is a good revision course for me as well as learning new things, I wrote in octave more recently which is like matlab and similar to C++.
@achilles280412 жыл бұрын
Yup, there are many other common uses for recursive function, for instance we can make a function that shows nth term of fibonacci series int fib(int n) {if (n==1 || n==2){return 1;} else (return (fib(n-1)+fib(n-2);}
@sally18158 жыл бұрын
I had some major issues with this but writing it out and following exactly what the computer did helped me a bunch. x=5 we run ff(5) we get 5 * ff(4) we run ff(4) we get 4 * ff(3) so we run ff(3) we get 3 * ff(2) so we run ff(2) we get 2 * ff(1) so we run ff(1) we break the recursion here because x=1 so we run the if code we get 1 so essentially ff(5)= 5 * ff(4) ff(4)= 4 * ff(3) ff(3)= 3 * ff(2) ff(2)= 2 *ff(1) we break the recursion here because x=1 so we run the if code ff(1)= 1 now we can solve 2*ff(1)=2 now we solve 3*ff(2)=6 now we solve 4*ff(3)=24 now we solve 5*ff(4)=120
@MoNeyAssasin8 жыл бұрын
i think other way, we give value of x = 5 so the code run until if x==1--this is false,so else is true,then is 5*(x-1=4)=20 then go over 20*3=60, 60*2=120 now is x==1 so return 1 so answer 120
@TamNguyen-wd4op10 жыл бұрын
This lesson's nuts. Every time you run any recursion program, the computer displays that phrase infinitely.
@davidsfc913 жыл бұрын
Your tutorials are great, crystal clear, keep the good work.
@meove12133 жыл бұрын
dude, im so lucky found your video. im was easy to understand. thanks!!
@idletyrant7711 жыл бұрын
Thank you so much sir. This is exactly what I needed to study for finals!
@rjranjeet1611 жыл бұрын
Bucky ,,u r great man,i watched ur android,iphone,java,& c++ tutorial,amzing,stuff,i realy apreciate ur efforts & the knowledge,kep it up..
@evanmastermind10 жыл бұрын
I don't like recursion.
@evanmastermind10 жыл бұрын
Actually a few months later and i like recursion. Bucky makes it seem more complicated than it should be. (Which is surprising because usually he makes things simple.)
@DanT-iu6oc5 жыл бұрын
@@evanmastermind Im still in the "fuck recursion i fucking hate my life" phase lol. hopefully i'll get to your second comment one day
@stormy15145 жыл бұрын
@@DanT-iu6oc what do you think now?
@DanT-iu6oc5 жыл бұрын
@@stormy1514 wow what a throwback. yeah, i understand it now. takes a while to sink in.
@erik.rodriguez5 жыл бұрын
I don’t understand yet:(
@annapurnaseelam53245 жыл бұрын
This is the most easily explained video
@Usamapir037 жыл бұрын
Bucky you are doing really well , keep it up Dude.
@phee3D6 жыл бұрын
if you didn't understand, here's how it works: loop 1: x is not equal to one so run else statement which is: x * factorialfinder(x-1) for that we need value of favtorialfinder(x-1) which is found in loop 2. x-1 is now the new value of x for next loop loop 2: x is not equal to one so run else statemement which is: (x-1) * factorialfinder ((x-1) -1) for that we need to find value of factorialfinder((x-1) -1 ) which is found in loop3. ok now that i think about it i think there's not really a way to explain this in a simpler way..i think best way to understand is write the code down on a piece of paper and see how each loop works
@saminishmam60919 жыл бұрын
I don't get it, returning 1 means that it should print out 1, right? I understood the whole thing but I can't simply understand why returning 1 would return 120. Someone please reply!
@chili241379 жыл бұрын
+Samin Ishmam Well, the way I understand it is like this, so if we follow the number 5 through it goes something like this, we at first return 5*(whatever the function returns) which is like 5*4*(whatever the function returns), then 5*4*3*(whatever the function returns) and it keeps going till it hits 1 and then what it returns is 5*4*3*2*1, so it kind of goes like this. Pretty weird, doesn't exactly works like other aspects of programming because the storage of the number isn't really like anything else in c++. I understand why he said it's a widely hated thing, when I learned it in school isn't wasn't too widely hated but we moved through it pretty quickly with a fibonacci sequence, I can imagine how annoying it would be to program some giant using a bunch of recursion to solve problems.
@cantcode10016 жыл бұрын
The first call, it returns 5 * the output of the second call, which is 4 * the output of the 3rd call which is 3 * the output of the 4th call which is 2 * the output of the 5th call which is 1. Then all the nested function calls “unwind” off the stack, leaving you with 1 * 2 * 3 * 4 * 5.
@pleasecontactme42745 жыл бұрын
well after changing the return values i found out the return 1 means 1 times the older values, if u did return 10 it would multiply it by 10 leaving 1200
@abrahamshepher93214 жыл бұрын
it means it starts from x= 5 to toward the base case 1 then it stops there
@alexandramariepascual35504 жыл бұрын
kzbin.info/www/bejne/lYDQg3qgl96tpNE that video helped me, it explained how the computer does the computation
@rayzecor8 жыл бұрын
I haven't heard about this in class, or anywhere ever, I haven't even watched the video yet, but I only read the name and I already think this is going to be some mind twisting unnecessary stuff. Edit: I know I'm probably going to regret saying this but this seems failry easy, fluid and really usefull.
@010arman01012 жыл бұрын
Yes a loop would be easier, but a recursion is for when you've finished your loop and you want to increase efficiency in your program. In huge programs the accumulative recursions will make your program significantly faster than if they were just loops.
@lockerzjunk78610 жыл бұрын
Wish I found your channel earlier would've helped me so much this semester. Should I keep trying even if I have to retake the class?
@gararsigursson405410 жыл бұрын
even if you fail the class this time, the stuff you pick up will make it that much easier next time around. Go for it.
@jiajingbeh82803 жыл бұрын
@RblxGaming How is the result?
@MrFilipeGB11 жыл бұрын
Basically, in the first loop you're multiplying 5*(something you don't know), and that something is 4! of course but the program doesn't know, so the second member of multiplication will just call the function again, but when you do it you won't find 4! immediatly, just that 4! is 4*something(3!) - it will need to call the function again and again, until you know that something = 1. Then the program can go backwards and solve all the pendent functions. It can be very confusing the first time
@SackSean14 жыл бұрын
Im going to be doing Comp Sci next year and i find recursion very fun.
@hanzalaashraf56053 жыл бұрын
kzbin.info/www/bejne/nqq1q3uQra98iZI
@mrtomas6217 жыл бұрын
Great tutorials. Thanks to you my job interview today was successful 😃
@davidcadieux63148 жыл бұрын
great video.. just what I needed to help study before a test
@emrekazoglu44615 жыл бұрын
there is no hard to get thing when you teach Bucky thnk u
@dend15 жыл бұрын
True Damage Ekko liked this video
@MrJepcats13 жыл бұрын
@johnthesman factorialFinder(5){a} {a}return x*factorialFinder(4){b}; {b}return x*factorialFinder(3){c}; {c}return x*factorialFinder(2){d}; {d}return x*factorialFinder(1); {d} returns 1, which puts 1 into {c} where x is 2 and so returns 2, which can now put this into {b} where x is 3 and returns 6, which can now be put into {a} where x is 4 which returns 24, which can now return to the original factorialFinder and finally multiply the original 5 by 24, returning 120. Hope that makes sense.
@lamyaa15948 жыл бұрын
I LOVE YOU!!! THANK YOU MAN I FINALLY UNDERSTOOD IT
@DragonSolidSnakeNY13 жыл бұрын
a for loop would be more or less the same amount of lines but recursion comes in handy for more complicated problems where loops become more tedious but recursion requires more thought because its more elegant.
@SmithsRichard12 жыл бұрын
thanks lot dude. your comment helped me understand this properly.
@legoobear681010 жыл бұрын
I understand that this is a very simple explanation, but if you're going to use int as your data type you should make your base case x
@noursukkar183511 жыл бұрын
the main benefit of functions is that you can call it several times whereas for the while loop you can only do it once
@faizameen19096 жыл бұрын
Just subscribed because of your easy explanation
@loudspace89656 жыл бұрын
Finaly i understand this .Thanks a lot for your explanation🙏🏻
@UnspokenHonor11 жыл бұрын
I thought the same, but if you use a loop you have to have another variable that stores the values. This also allows for more than one exit point while still using the 'return x;' . This is all I could come up with, but I am only learning this stuff for the first time as well.
@tevoaol7 жыл бұрын
Thank you! It was very helpful. You just earned a new subscriber
@EndTheFilms7 жыл бұрын
You pretty much saved my ass, late night, need to study for a test, found this!
@Matthmatt121311 жыл бұрын
You're right, he's not misspelling nearly enough words.
@subs2meplease13 жыл бұрын
Oh NVM, ignore my last comment. Factorial is pretty easy, i've never done it before, but is just simple multiplication :) I get this now, thanks :D
@FA9EL7DEE13 жыл бұрын
DUDE !! ur waaaaaaaaaaaaaay better than my prof !! thanks ALOT
@mantronicsenterprises5 жыл бұрын
Great tutorial, thanks for making it easy to understand.
@gonzo19114 жыл бұрын
oddly enough i loved recursion back in school, found it easy but tricky at first
@Shehryarzaheer1127 жыл бұрын
Always love Bucky's tutorials how they make learning programming easy. But in this one, like every other teacher, bucky tried to teach recursion in a very simple way and that simple way was not enough for me to understand recursion clearly. And so, I had to learn recursion from stackoverflow. But still love the way you teach.
@TheAwakeningMission8 жыл бұрын
Factorial in one single line: int fatorial (int x){ return x==1? 1: x*fatorial(x-1); }
@TheAwakeningMission8 жыл бұрын
Hell yes, correct, tks.
@shayan_ecksdee8 жыл бұрын
why do people use if else, if theres ternary?
@alionking10234 жыл бұрын
0:05 yup, described me 100% accurately
@nishaanazzat11 жыл бұрын
YOU SIR ARE A LIFESAVER
@SleepyRickyC928 жыл бұрын
Thanks for these videos man. lol totally agree with people hating recursion. It is a definitely a confusing concept.
@zyrohnmng12 жыл бұрын
You have: 1. While loops 2. For loops 3. Self made loops through recursion.
@RedsBoneStuff9 жыл бұрын
I am a cs student and I like recursion.
@thechosenone4217210 жыл бұрын
u are king maaan !! the best !! thank u for all videos !!
@jennytantos50404 жыл бұрын
I'm from Philippines I'm always watch your tutorial
@prajwal89610 жыл бұрын
Thanks mate it really helped me to climb out of d mess
@dimashur10 жыл бұрын
isn't it slower than simply calculating facorials using loops? i mean, this function has to run until it returns 1 eventually, and than it goes back to calculating. looks like double the work. or am i missing something?
@jas47685 жыл бұрын
this is just an example of how they are used. they arent just used to create factorials.
@XRaYNL14 жыл бұрын
zomg, i'm studying computer science for 2 years now... and this still confuses me oO But this is SOO well explained! This is the perfect way to make a sudoku-solver!
@hanzalaashraf56053 жыл бұрын
kzbin.info/www/bejne/nqq1q3uQra98iZI
@XRaYNL3 жыл бұрын
@@hanzalaashraf5605 My original comment originates from over 10 years ago. I eat recursion for breakfast nowadays xD
@wh33l0fd00m13 жыл бұрын
@ryangr0 Yes, this exact case would be easier using a loop.There are things tho that cant be made with regular loops.Say the user has to enter a number x and a number n and the program has to compute x^n (x*x*x n times).If you tried to do it with a loop like for (int i=1; i
@ekremkarahan8 жыл бұрын
I really like the way u explain.
@eyoasdaniel42442 жыл бұрын
That's ma men you saved my time no more worry about recursion 😉 tnx any way
@penguin06169 жыл бұрын
I'm not even that far in math yet, but thanks for the little math lesson on factorials xD
@KENARDO13 жыл бұрын
@spidey678 Recursion means, that within a method/function, you call the same method/function (or one that calls the first one) to accomplish a backwards loop. If done right, it'll do anything you could do with a While or For loop, but backwards. If done wrong, it'll do anything you could do with a While(true) loop. But since it calls itself within itself, I made the inception joke.