Data Structures Using C++: Illustration of Recursive Function Calls (Call Stack)

  Рет қаралды 73,768

ReelLearning

ReelLearning

Күн бұрын

Пікірлер: 110
@navidgol5786
@navidgol5786 10 жыл бұрын
I don't know why our teacher wants to complicate everything! thank's man that was an awesome video!
@zyro9922
@zyro9922 6 жыл бұрын
No complications. Just concept. Thanks man. Really helpful.
@rashidselemani475
@rashidselemani475 3 жыл бұрын
I was very confused, but today my confusion get a medecine. Long life to you Sir. I subscribe right now!
@michaeldunleavy326
@michaeldunleavy326 9 жыл бұрын
well, that was the best explanation of recursion I've seen. thanks a lot :-)
@sahawndada
@sahawndada 5 жыл бұрын
This is such a good explanation on a tough topic. Thanks for helping me finally get it !
@nehemiahadeosun5585
@nehemiahadeosun5585 9 жыл бұрын
Thank you very much, you've saved a soul today.You are blessed...
@annafebland4460
@annafebland4460 11 ай бұрын
Thank you thank you! May God bless and protect you and your family ❤
@Ghost-nz4fx
@Ghost-nz4fx 3 жыл бұрын
It's the best explanation ever! A simple explanation and straight to the point. Thank you so much.
@ambujsingh4406
@ambujsingh4406 2 жыл бұрын
I made many programs in java and c and was debugging them with breakpoint to understand how it works and saw many videos wasn't satisfied but in SoloLearn someone had given your video link i don't click on links normally but i had no options either so i wanted to take a chance. And now i understand it how it works thanks man Liked and Subscribed your channel ❤️
@underrated_mono9770
@underrated_mono9770 2 жыл бұрын
I still love this video because intuitive and concise. great video!
@paulm6084
@paulm6084 2 жыл бұрын
Very clear. Mocked up the video in python. Code: def factorial(i,x): print("factorial function invoked. Stack frame #",i,"named: fact(",x,")") if x == 0: print("Base case reached. ") print("factorial function fact(",x,"), returned value:",1," Stack frame #",i, " popped from the stack.") return 1 else: y = x* factorial(i+1,x-1) print("factorial function fact(",x,"), returned value:",y," Stack frame #",i, " popped from the stack.") i-=1 if i == 0: print(" Stack is cleared.") return y factorial(1,4)
@spicytuna08
@spicytuna08 6 жыл бұрын
in order to make this video more complete, local variables and the logic usage of these variables are needed. it is not just the arguments that need to be traced but the local variables are very crucial in order to trace the recursion.
@blinkerhawk
@blinkerhawk 6 жыл бұрын
thx~
@meditationkaiinsaf5505
@meditationkaiinsaf5505 3 жыл бұрын
Can you explain please about it?
@SpawnEmdee
@SpawnEmdee 5 жыл бұрын
Thank you! I was having headache understanding recursion. your explanation is the best!!
@siphiwekarimakwenda9313
@siphiwekarimakwenda9313 3 жыл бұрын
The perfect recursion tutorial!!!!
@dfla5472
@dfla5472 3 жыл бұрын
THANKS !! Precise and simple explanation.
@TheHolyReality
@TheHolyReality 10 жыл бұрын
Very well explained , plain , simple and precise.
@wowzande
@wowzande 7 жыл бұрын
good stuff! finally understand recursion! to a certain extent much better then what they taught in class!
@RacerSteelz
@RacerSteelz 6 жыл бұрын
this was really helpful thanks a lot, didn't understand this for the longest time
@SidonDuarte
@SidonDuarte 3 жыл бұрын
Really! The best explanation.
@muhammadawaisbhatti942
@muhammadawaisbhatti942 8 жыл бұрын
Thank you for the explanation of states of program execution stack during recursion. However, i think what you missed is, focus on control, you forget to tell how control will shift from first recursion call to second recursion call and how did the control will return back for every recursive call.
@sharphon
@sharphon 11 жыл бұрын
Great explained. Now it's clear why recursive functions are dangerous :D
@petruciucur
@petruciucur 7 жыл бұрын
Very simple and concise. Thanks !
@abdullahsorathia3394
@abdullahsorathia3394 11 жыл бұрын
Thanks a lot clarifying my doubts.You teach Like a Pro..
@willwillwill-91
@willwillwill-91 10 жыл бұрын
Great explanation, really helpful, much better than my text book
@Farrukhw
@Farrukhw 6 жыл бұрын
Waooo, how simply it gets into my brain.... Thank you very much....
@elephantride8912
@elephantride8912 8 жыл бұрын
easy to undersatnd. ..Thanks for ur effort
@durgapalepu5780
@durgapalepu5780 10 жыл бұрын
I liked the pictorial way of explaining the concept!!
@faris899
@faris899 8 жыл бұрын
Wish you were my professor
@vickyees
@vickyees 3 жыл бұрын
Amazing sir! You made it clear!🙏
@mehedibd89
@mehedibd89 7 жыл бұрын
Great Explanation! Thanks for your video.
@richie.edwards
@richie.edwards 11 жыл бұрын
Very clear explanation. Thanks.
@pipebomb8562
@pipebomb8562 6 жыл бұрын
fantastic explanation. Impressed
@nadiahzulkifli3867
@nadiahzulkifli3867 6 жыл бұрын
you help me a lot sir! so nervous for the presentation and after watching this, i know how to explain
@rawanfouda2291
@rawanfouda2291 5 жыл бұрын
Just what I needed. Thanks a lot!
@ar1y3n
@ar1y3n Жыл бұрын
Thanks a lot sir, I just understood the whole thing very easily
@sunikshitmahajan2198
@sunikshitmahajan2198 Жыл бұрын
amazing explanation. hats off!
@rogueflynn
@rogueflynn 11 жыл бұрын
Thank you! This really helped my understanding.
@gazisalahuddin8681
@gazisalahuddin8681 5 жыл бұрын
a million thanks..keep up the awesome works
@kazenohito7641
@kazenohito7641 8 жыл бұрын
Jesus christ I hate my school. After watching your video I googled and then read the chapters in my book about stacks and queues and not recursion makes so much more sense. I don't get why my university thinks its ok to try to make us write programs recursively without an understanding of what actually happens with your data.
@zoranjovanov8564
@zoranjovanov8564 8 жыл бұрын
u have to look up on ur own.
@kazenohito7641
@kazenohito7641 8 жыл бұрын
Yeah I know.... That's how I got here. Thank you captain obvious.
@zoranjovanov8564
@zoranjovanov8564 8 жыл бұрын
haha that was not the point :d wanted to say school only gives u the very basics and the rest is up to us:P
@meditationkaiinsaf5505
@meditationkaiinsaf5505 3 жыл бұрын
@@zoranjovanov8564 thank you
@sayednaweed745
@sayednaweed745 5 жыл бұрын
Great explanation
@MrWardo2009
@MrWardo2009 3 жыл бұрын
Thanks for making this video!
@quyhai1019
@quyhai1019 Ай бұрын
best explanation!
@abhishekjha2957
@abhishekjha2957 4 жыл бұрын
This helped me a lot.
@trixxter3817
@trixxter3817 4 жыл бұрын
Super explanation ❤️
@saptarshisahoo5075
@saptarshisahoo5075 9 жыл бұрын
its very helpful. Thank you sir.
@Omioblivion
@Omioblivion 11 жыл бұрын
Great video, yet again.
@ashok845
@ashok845 11 жыл бұрын
Well explained! Can you please explain merge sort using recursion in the same manner.
@onealoneal7047
@onealoneal7047 2 жыл бұрын
For the if\else structure you don’t have to use curly braces if you only have single instruction to write
@VihangaHeshan
@VihangaHeshan 12 жыл бұрын
Very useful................
@TamImBlessed
@TamImBlessed 9 жыл бұрын
You just saved me, thanks for helping.
@mishanshah6827
@mishanshah6827 5 жыл бұрын
Very nice 👌
@AlMarufSharif
@AlMarufSharif 10 жыл бұрын
Nice explanation!!
@SillyPlanet92
@SillyPlanet92 6 жыл бұрын
great explanation. thank you
@DavidSprings
@DavidSprings 11 жыл бұрын
Great way to create deep subdirectories on a drive. Really, really deep. Trust me.
@DavidSprings
@DavidSprings 11 жыл бұрын
Patrick Davis I ended up creating subdirectories within subdirectories until either Windows crashed or the drive filled up.
@dangerrrman
@dangerrrman 12 жыл бұрын
Thanks for clarifying this topic :-)
@petruciucur
@petruciucur 8 жыл бұрын
Great ! Thanks a lot !
@Darkion45
@Darkion45 12 жыл бұрын
great explanation, thanks!
@nasircsedu
@nasircsedu 11 жыл бұрын
it's awesome, man
@djavadovjavoxir2248
@djavadovjavoxir2248 3 жыл бұрын
thank u bro good luck your life!
@mlungisinkomo2382
@mlungisinkomo2382 8 ай бұрын
well............ this makes sense 😊thanks man
@sherif4csharp
@sherif4csharp 5 жыл бұрын
Thanks for your help
@BharatChandak1
@BharatChandak1 11 жыл бұрын
awesome explanation :)
@michaelcollins4325
@michaelcollins4325 7 жыл бұрын
once again, your videos save my ass; you always explain it better than my professors :D, thanks!
@MiladZohravi
@MiladZohravi 10 жыл бұрын
very special thanks
@NZFoxy
@NZFoxy 3 жыл бұрын
Thank you so much!
@sarahlakehal3378
@sarahlakehal3378 3 жыл бұрын
lol watching this 3 hours before my exam
@petesandwich3246
@petesandwich3246 9 жыл бұрын
Would iterative function utilize less memory since it essentially increments a variable rather than creating N stacks?
@ozzy2361
@ozzy2361 3 жыл бұрын
Thank you so much!!
@kirolosyassa5798
@kirolosyassa5798 5 жыл бұрын
it was so helpful :)
@unplugged406
@unplugged406 8 жыл бұрын
God bless you son
@Richard-yz2gy
@Richard-yz2gy 9 ай бұрын
hi there what happens if a value is not getting returned to the previous stack frame??
@apurvatiwari2
@apurvatiwari2 12 жыл бұрын
Thanks a lot mate!!!!!!
@jorgetadeo510
@jorgetadeo510 6 жыл бұрын
What would be the run time and space complexity of this?
@noreplywiggle42
@noreplywiggle42 Жыл бұрын
nice man
@Malak_95y
@Malak_95y 9 жыл бұрын
thank you so much
@supreethavadhani8916
@supreethavadhani8916 8 жыл бұрын
helped a lot!
@hortinus
@hortinus 4 жыл бұрын
What if n
@kashif2309
@kashif2309 5 жыл бұрын
how come num equals to n in the factorial function?
@ManishKumar-kc1cn
@ManishKumar-kc1cn Жыл бұрын
Thanks sir
@artteaparty
@artteaparty 8 жыл бұрын
That's a great video, just I have a problem. Sometimes in some program it happens that the result of Recursive Function comes backward. You know, like instead of printing 1 2 3 ..., prints 3 2 1. Can you give some hints?
@Kalo953
@Kalo953 8 жыл бұрын
+sasa february in order to understand why it happens you need to understand the call stack and what happens when you have statements after the recursive call of the function.
@meditationkaiinsaf5505
@meditationkaiinsaf5505 3 жыл бұрын
Cause, Stack follows FIFO (First In First OUT).Thank you
@logeshs9370
@logeshs9370 6 жыл бұрын
nice expl
@sunflower20505
@sunflower20505 9 жыл бұрын
thank you.
@Strategic.
@Strategic. 3 жыл бұрын
Dude you still alive? Have you built anything amazing so far?
@harshitpatnaik6381
@harshitpatnaik6381 7 жыл бұрын
Thank you vry much
@SearchingPeaceInside
@SearchingPeaceInside 7 жыл бұрын
What happens to rbp, rsp in assembly
@ghostinthedarkness30
@ghostinthedarkness30 10 жыл бұрын
thank you!!!
@MegaCooloman
@MegaCooloman 6 жыл бұрын
Could we have chosen n == 1 as a base case? seems like it would work but is it bad design? Pardon my bad English !!
@GrandofTheftHero
@GrandofTheftHero 5 жыл бұрын
Sorry for the late reply; you may have already found the answer to your question. You can technically get the same result with a base case of (n==1), but it makes more mathematical sense to make it (n==0), because the factorial of 0 is 1.
@meditationkaiinsaf5505
@meditationkaiinsaf5505 3 жыл бұрын
@@GrandofTheftHero Thanks for clear me.
@LuaneCarolineAquinoCavalcanti
@LuaneCarolineAquinoCavalcanti 9 жыл бұрын
thanks a lot
@gluetubeserver
@gluetubeserver 9 жыл бұрын
+Luane Caroline Aquino Cavalcanti are you in CS?
@LuaneCarolineAquinoCavalcanti
@LuaneCarolineAquinoCavalcanti 9 жыл бұрын
+RepentHarlequin yes !! third year
@gluetubeserver
@gluetubeserver 9 жыл бұрын
Luane Caroline Aquino Cavalcanti wow! You are a unicorn, not many females in tech right now, way to go!
@LuaneCarolineAquinoCavalcanti
@LuaneCarolineAquinoCavalcanti 9 жыл бұрын
+RepentHarlequin thats right, but is changing, thats nice
@Icecube88
@Icecube88 6 жыл бұрын
first one in, last one out.
@ilayasaravanan
@ilayasaravanan 2 жыл бұрын
Amazing video mate. Helped understand recursion. Until I saw this illustration, I have to say, my grasp of recursion was dodgy.
@pixelnetwork1430
@pixelnetwork1430 11 жыл бұрын
Looks like 4x Fart (3)
@padmanabhmishra9669
@padmanabhmishra9669 2 жыл бұрын
Thank you.
The C++ Call Stack
23:31
Richard Klein
Рет қаралды 7 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 105 МЛН
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
Data Structures Using C++: Traversing a Linked List
17:57
ReelLearning
Рет қаралды 51 М.
Data Structures Using C++: Using Recursion to Process a Linked List
13:07
This is a Better Way to Understand Recursion
4:03
Alex Hyett
Рет қаралды 59 М.
Call Stack, Scope & Lifetime of Variables
16:51
ReelLearning
Рет қаралды 49 М.
WHY IS THE STACK SO FAST?
13:46
Core Dumped
Рет қаралды 173 М.
15 Years Writing C++ - Advice for new programmers
4:04
SyncMain
Рет қаралды 1,3 МЛН
Tracing a recursive function
12:40
HurrayBanana
Рет қаралды 20 М.
wtf is “the stack” ?
8:03
Low Level
Рет қаралды 110 М.
Call Stacks - CS50 Shorts
7:40
CS50
Рет қаралды 127 М.