This is a Better Way to Understand Recursion
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 2024
- People often explain recursion in the form of an infinite loop. Recursion doesn't work that way; it is actually a lot like the movie Inception, and in this video, I will show you how!
☕️ I don’t accept paid sponsorships and I have turned off mid-video ads. You’re welcome! If you would like to support my channel see: ko-fi.com/alex...
📨 Join my free weekly newsletter for advice, technology and more: newsletter.ale...
🗺️ Backend Developer Roadmap: www.alexhyett....
📝 Read me instead: www.alexhyett....
🎓 RECOMMENDED COURSES (Use code FRIENDS10 for 10% off)
The Complete Web Developer Course - academy.zeroto...
The Complete Junior to Senior Web Developer Roadmap - academy.zeroto...
Complete SQL + Databases Bootcamp - academy.zeroto...
📚 RECOMMENDED BOOKS
Clean Code - geni.us/5AEwj2
Domain Driven Design - geni.us/WiR0Q0x
Design Patterns - geni.us/5ncUt
Developer Hegemony - geni.us/lAXy
Pragmatic Programmer - geni.us/GfNj9
Data Structures and Algorithms Made Easy - geni.us/sqg6kJ
Refactoring - geni.us/ufAP0mE
Pragmatic Thinking and Learning - geni.us/x81A
Microservices - geni.us/8vMA
🚀 MY FAVOURITE TOOLS
PIA VPN - piavpn.com/Ale... (86% off)
Visual Studio Code - code.visualstu...
Obsidian - obsidian.md/
Notion - affiliate.noti...
You can check out more of my favourite tools on my website:
www.alexhyett....
🔗 MY KEY LINKS
🌍 Blog - www.alexhyett....
🐘 Mastodon - social.alexhye...
🧑💻 WHO AM I
I’m Alex, a Software Developer and TH-cam working in the UK. I make videos about software development to help developers with the skills they need to be senior developers. As well as this TH-cam Channel, I also write articles on my website (alexhyett.com) as well as write a regular newsletter that contains some thoughts to help aspiring developers.
‼️ DISCLAIMERS
Some of the links in this description are affiliate links, for which I get a small commission, at no extra cost to you 🙂. I appreciate you supporting my channel so I can continue providing you with free software development content!
Use of clips from Inception (2010) is under Fair Use:
Copyright Disclaimer under section 107 of the Copyright Act 1976, allowance is made for “fair use” for purposes such as criticism, comment, news reporting, teaching, scholarship, education and research.
#coding #programming #developer
Bro gave us the inception example and i thought he was going to explain it differently, then boom fibo is back
bro said ‘this is a better way to understand recursion’ and proceed not to explain anything useful
The recursive joke here is that this is just like any other explanation of recursion
To understand recursion you need to understand recursion first 😮💨
To understand recursion you need to understand recursion first 😮💨
@@alexhyettdev To understand recursion you need to understand recursion first 😮💨
@@douglasmasho2324 To understand recursion you need to understand recursion first 😮💨
@@garryanderson9831 To understand recursion you need to understand recursion first 😮💨
@@alexhyettdev To understand recursion you need to understand recursion first.
The problem is that, I cant think recursively when it gets too complex or too deep. I just lose the track or get overwhelmed. I have seen Factorial or Fibo example a dozen times but cant come up with a one all by myself.
In your next video, could you please explain recursion?
In your next video, could you please explain recursion?
@@sagarshah5341In your next video, could you please explain recursion?
@@marcusantenor793 In your next video, could you please explain recursion?
@@Shubham-fo7ug if explanation is null return recursion explanation
You just told the surface level information/definition. I was hoping you would help develop an intuition for recursion
Wow, stumbled upon this video and floored by the quality of the explanation and inception analogy. Thank you so much!
Thank you! I am glad you liked it.
"Let me explain recursion by relating it to a notoriously convoluted movie." 😂
Great explanation and visuals Alex 🔥
Thank you!
love the comparison to a movie, keep up the great videos!!
I dont understand recursion, esp how many times to call it or what operator to use it with. I honestly thank God for loops
the inception analogy was Brilliant!
thank you so much! I loved the analogy, it really helped and now I must go watch inception again. Ive had a hard time wrapping my head aroound python, I mean I ace my classes so that must mean I understand it right? it just feels like Im not getting it.
Why did the programmer get stuck in a recursive loop?
Because he wanted to see how deep the rabbit hole went, but he forgot to include a base case in his recursive function. So he just kept calling the function over and over again, each time passing in the same parameters, until his stack overflowed and his program crashed.
But don't worry, he learned his lesson. From then on, he always made sure to include a base case in his recursive functions, and he never got stuck in an infinite loop again... at least, not until he started playing with pointers and accidentally created a memory leak.
Ah, programming. The gift that keeps on giving, even when you wish it would just stop already.
Loved this! There is always something to trip us up. My favourite one is debugging race conditions. They are impossible to replicate if you are stepping through code.
Can't believed I watched 10 minutes plus of videos trying to understand this only to get it on a 4 minutes 3 seconds video😂.
Bro stop with the fibonnaci example, its too easy. It wont help me understand how to get the height of a node in a tree. Surprisingly i can code it but i dont understand it.
thanks for the explanation 🙂
Im learning for some time coding, but recoursion is one of those things that Im very bad at. If you dont need to nest it in the loop its not that hard. But one you need to use it in like 2-3 loops it gets hard.
Very good quality video. It's too high level for my needs though. I need to understand what's happening on the stack and with the stack frames. Do you do anything with combinatorics? Like how to use recursion to find unique combinations of k integers from a list of n integers? I ChatGBT'd it and walked through the solution. The solution wraps a recursive call into a for loop. I can almost trace it, but it is very difficult to understand. I get the impression this is a well-known problem, but I had no prayer of solving it myself because I don't know how to think through it.
If you want a proper answer, the first step is to stay away from webdev channels.
same bro
This is a Better Way to Understand Recursion
tomorrow i have an exam n the question will be like they will give me last part of the recursive r any code n want me to write the recursive form of it yet i couldnt get my answer that how to know to write that.
if u or anybody know the proceture i will be grateful if u guys tell me.
"Don't worry, I won't spoil the movie Inception for you"
Proceeds to spoil it for me💔
It doesn’t spoil anything beyond what you learn in the first 10 minutes of the film. I watched it again last night. Great film even though it is 13 years old already!
did you mean recursion? (this was really funny haha)
thanks very much simple to understand
can you explain to us what is BacktrackingFile please
The best video on recursion
What an example 🙏
Was stuck at why it return back (kick) later understood just thinking logically 😂
Now everything clear 😅👌
Btw now I get it why people call some youtubers underrated😢
recursion
Great video!
Thanks!
stack overfflew
🔁
did you mean recurions
Recursion
Nice work! Adding memoization would mitigate some of the inefficiencies you mentioned.
I know you want to be fast for youtube because it's cool and edgy, but if you want people to learn from your videos, pause when you show code or equations and leave them onscreen for a few seconds so people can see what you are talking about - the human brain doesn't do well trying to read and listen at the same time.
I have tried slowing it down a bit in newer videos. It's not really about being cool and edgy (I am too old for that), I just speak faster when nervous. I am still not that comfortable talking to a camera!
char* understandRecursion(){
int understood = 0;
If(understood)
return "finally";
else
return understandRecursion;
}
Notice that understood never becomes 1
recursion is like:
recursion is like:
recursion is like:
recursion is like:
...
Now do corecursion 😂
What was this? And why did TH-cam put it on top in my search? BS
th-cam.com/video/Q83nN97LVOU/w-d-xo.htmlsi=nmNVMsu6AHailDE_
That
actually
makes
sense!
And
It
This is a BAD explanation..
thanks for teaching. NOTHING. so i learned.....NOTHING. !! what a JOKE. !!
Why watch a video on recursion if you already understand it?
With a comment that dumb; it's safe to assume you're not going to understand recursion no matter how it is taught.
Fuxk this recursion i leave programming because for this recursion. Now im doing mba 😅
To be fair there are only a handful of times that I have put recursion to good use. You could always go back to programming once you have your MBA and start SaaS company!
Great video!!!
Great video!!
Great video!
Recursion
Recursion
Recursion
Recursion
Recursion
Recursion
recursion
recursion
recursion
recursion
recursion
recursion