# recursion = a function that calls itself from within # helps to visualize a complex problem into basic steps # problems can be solved more easily iteratively or recursively # iterative = faster, complex # recursive = slower, simpler # ----- EXAMPLE 1 ----- # ITERATIVE def walk(steps): for step in range(1, steps+1): print(f"You take step #{step}") # RECURSIVE def walk(steps): if steps == 0: return walk(steps - 1) print(f"You take step #{steps}") walk(100) # ----- EXAMPLE 2 ----- # ITERATIVE def factorial(x): result = 1 if x > 0: for i in range(1, x + 1): result *= i return result # RECURSIVE def factorial(x): if x == 1: return 1 else: return x * factorial(x - 1) print(factorial(10))
@ЙирюВонаирда2 жыл бұрын
does it even make sense? I mean... why choose recursive way to solve a matter? Is there any advantages outside of simplification? Mb memory consumption or speed? Why use it if u dont mind complex code? Any example where recursion gave a more suited solution than iterative way?
@captainhostile101 Жыл бұрын
@@ЙирюВонаирда i sure need em for tomorrows exam
@recursion.Ай бұрын
Good to see so many people interested in me🥰🥰🥰
@AvidAfricanАй бұрын
😂😂
@OceanLover80082 жыл бұрын
Thanks bro for always uploading extremely useful content for free. I'm a student right now and I really appreciate all the efforts that you are taking. ❤️ Proud to be a 'Bro'. 😎
@BroCodez2 жыл бұрын
thanks for watching 😎
@itayzabar29532 жыл бұрын
Hi Bro Code! I'm studying computer science in highschool rn and after two month learning how to use recursion i am still struggling. I think that your video on it might gave me some crucial insights about the topic and the usage of it. Thank you so much❤️ I rly like your videos so keep creating great content!! Have a great day!
@Loco4Waffles9 ай бұрын
Best example I have seen on explaining recursion
@zabehullahalizadeh23102 жыл бұрын
Learn python with Bro is as enjoyable as playing our favorite games
@mihailomilenkovic63822 жыл бұрын
True
@randymartin90403 ай бұрын
This taught me something about the stack and how code functions that I haven't learned from anywhere else, invaluable. Thank you! Blessings.
@ssmith50482 жыл бұрын
Excellent explanation and examples!
@t2trix122 күн бұрын
This is the first time I've kind of understood recursion, the minecraft visual and the code comparison to the loop in this video specically is great
@salihmorta417211 ай бұрын
This is the best BEST explanation for recursion I’ve ever heard
@shoukatiqbal56742 ай бұрын
very impressive demonstration well done Sir
@edipedipbulmaz2 жыл бұрын
I just wanted to thank you. For teaching me programming and starting my coding career. Tanks again.
@Wolfoffreedom1112 жыл бұрын
Great 👍
@eddisonlewis8099 Жыл бұрын
Very interesting illustration
@fluffyisyermom763111 ай бұрын
Bro is the g. Ty my friend. When other KZbinrs fail to deliver an answer that is simple and easy to understand, you come in and kill it. ❤ I was stuck on this for an hour before trying this video. But man I wish I knew this a month ago 😂
@randymartin90403 ай бұрын
Cool way of understanding this, thank you.
@audiemolinger64508 ай бұрын
Great course, great instructor
@farhisoki4805Ай бұрын
Help a lot, thanks
@chrisogonas4 ай бұрын
Very well illustrated! Thanks
@kadirv10 ай бұрын
excellent. well clarified 👏👏
@anshhmalviyaa Жыл бұрын
Best channel for learning to program on KZbin. ❤
@harley_randelo2 жыл бұрын
great video. thanks for uploading. and btw, first
@flashplaysyt57192 жыл бұрын
It is seems very essy to learn with you thanks for making videos
@onter7 ай бұрын
really well explained, good stuff
@Daniyar-AbuUmar Жыл бұрын
Subscribed and liked without even thinking twice
@Geniuspaul-Projects2 жыл бұрын
thanks allot for your help
@calmlivingclub2 жыл бұрын
Great sharing
@OllyCybSec8 ай бұрын
Thank You and Salute to @Bro Code‼️. I watched the entire 106 video playlist of Python. Brilliantly demonstrated and explained. 🏆🏆🏆
@abhisaragarwal90842 жыл бұрын
Sir your videos are very good thnx for uploading programming language tutorials for free.
@codecaine Жыл бұрын
Keep up the excellent work
@salamvip71452 жыл бұрын
👍 Good
@Osamu_GWAD2 жыл бұрын
Good job!!! 🤝
@induminidilukshaWijesinghe2 жыл бұрын
Mah bro , Thanks a bunch ❤️💐
@EmilioAt774 ай бұрын
As always, you are the best, Bro 🤝🏻🤝🏻
@杨玄-v4k11 ай бұрын
really helpful thanks bro
@SoundKing2 жыл бұрын
Hi Code Bro from what I can see, you are the most thorough and clear person teaching coding on KZbin. Whatever your teaching style it matches my learning style. Is there any chance that you can do a full course on React?
@piotrkopcewicz52272 жыл бұрын
great as usual !! thanks
@bryce38518 ай бұрын
This has showed me the important part for data analysis thanks bro 🙏
@MarcosBilly-x7y Жыл бұрын
cool video)
@fredcunningham804911 ай бұрын
Great tut, thanks!
@yashvashist53472 жыл бұрын
Thanks bro❤️✨
@tictactechin Жыл бұрын
from this video i learn that programming is solving your own error code problem while trying to achieve your goal code
@abdulhannan-18 Жыл бұрын
def add(*args): total = 0 for arg in args: total = total + arg return total print(add(1,2,3,4,5,6,7)) 28
@ZyrusAlvez10 ай бұрын
Thank you. No one told me that the best way to understand recursion is first understanding the stack
@hxhchimeraantarc22682 жыл бұрын
I am studying for finals right now and your videos are the best. You are so good at explaining. Thank you so much.
I'm a student of Telecommunications engineering, and I made Calculus Lambda with Haskell to improve my programmation abilities. And thanks to that elective I learnt how to use recursive.
@BüblySnowfláke-m3x7 ай бұрын
Who's watching dis in 2024,love all ur tutorials bro❤
@prizepig2 жыл бұрын
Just when I thought I was out, they pulled me back in.
@julia-kc3kp Жыл бұрын
hey! just realized i'm your 850,000st subscriber 🥳 love this channel, you are doing something very valuable and precious here. thank you for being an absolute bro!
@tigerli22629 ай бұрын
love it
@TheKr0ckeR9 ай бұрын
For 1 year later, learning 8 min tutorial decreased to 5 min. :D Thanks for the tutorial
@francescodiniccolo4 ай бұрын
Thanks Bro, that was a great explanation Bro
@kristijanlazarev10 ай бұрын
Finished in a less than a week, even though I work a full time job, very good course!
@Simonjoel-4696 ай бұрын
I really enjoyed watching your videos but I think you should share your resources pls...!!
@sweet_coconut2 жыл бұрын
thank you! now recursion is a bit clearer to me :)
@marshmelows2 жыл бұрын
I'm amazed how the recursive approach tends to be simpler to write. Thanks Bro Code!
Hey man, love your videos! Watched all the playlist to have a clear understanding when I get asked an algorithm question in an interview. However, I am struggling to find all the permutations of a given string and return the permutations in an array. Could you please make a video about it where you explain the recursion we use there in depth? (in Java please) Thank you...
@sinankodur4251 Жыл бұрын
Bro you are the best I am without words bro, your examples are perfect Anyone can learn coding with this Great work and big fan of you
@Nishitha_Jay9 ай бұрын
Thanks alot for this my Bro. You are a true BRO. ❤
@poi96963 ай бұрын
✨✨
@tilkesh Жыл бұрын
Thx
@rockey55082 жыл бұрын
I'm glad I found Bro Code, I'm still learning but Bro Code makes coding easy to learn.
@malvernmabvira15622 жыл бұрын
1:47 no brackets to define scope of a function. Java for me.
@sirwinkiebinkie8270 Жыл бұрын
You should add a positive only condition for the factorial in the recursice function :)
@BlahblAHbLaH-1_ Жыл бұрын
w vid
@arsacode6145 Жыл бұрын
you're doing gods work, bro
@realitybeckons4120 Жыл бұрын
Thank you
@Vue-daigle Жыл бұрын
Hi Bro, thanks for all the work you've put into these tutorials.
@GhostGaming-tt9tuАй бұрын
You are a legend
@AlexTerrable Жыл бұрын
Thanks bro
@BlountForceTrauma11 ай бұрын
Thank you!
@nik4465 Жыл бұрын
Thank you, Bro😎
@RexMan04 Жыл бұрын
Got my comp sci final in 1 hour and couldn't for the life of me figure out recursion before this (its 40% of my final). I think I understand it better now, and this should help me a lot!
@Chocolatey2410 ай бұрын
BROOO!! Finally I understand recursion 😂
@keldur16 Жыл бұрын
I understand what recursion is. I am struggling to understand why I would use it Love your videos tho. You’re always a major help.
@AbelBen-fz6hs8 ай бұрын
sick video dog. got 89% for my test just from this video
@mdayubali97512 жыл бұрын
could you please make devops or aws videos please......!
@ohChardy7 ай бұрын
last video of the playlist
@AayushBashyal15 ай бұрын
was it worth the watch?
@FaraDuMatin2 жыл бұрын
Bruh I just saw that in class on week ago and didn’t understood shit. You are a wizard my guy.
@Jess-xg7ok Жыл бұрын
I like the style of your video and the examples and the sample code. I am wondering if you can do the tutorial on Python Panda, NumPy, and others that are more commonly used in data analysis/data science? Thanks!
@Vue-daigle Жыл бұрын
Thks Bro, great Python videos simply explaining all these features of the language ... 😎 Would you consider moving on to commonly used frameworks like Flask + Strapi ? They seem to be complementary and powerfull for Web dev. (=
@ameyagupta7285 Жыл бұрын
tysm!
@QhY-j2e5 ай бұрын
Hi bro, may i ask the logic behind how at 2:28 changing the print function to below walk (steps -1) makes the counter go forward? i cant seem to wrap my head around it
@ThomasC-e8iАй бұрын
do you understand now?
@techdoors17992 жыл бұрын
Hey bro, I love your logo.
@informativecontent4778Ай бұрын
An easier approach to understand and solve finding the factorial of a number using recursion number, result = int(input("Enter Any Number")), 1 # both of these are global variables def fact(num): global result # to access and modify value of a global variable in python if num == 1: return result *= num # we need to use global keyword and here we are telling the function to change # the value of result globally fact(num - 1) fact(number)
@heinrichsmit22 жыл бұрын
Hey bro, was wondering if you could show us how to make our own JDK? That way one can conveniently use heaps of code without having to actually add libraries and modules when starting a fresh project. So we wouldn't be replacing JDK 19 but just adding our JDK to the IDE with our few packages we have in there to use.
@sohelqureshi41832 жыл бұрын
Sir you're can Please make video for django python course or playlist
@nxthingbutv0id9582 жыл бұрын
I’m the future, please do a series on rust
@KnightZephyr2 жыл бұрын
random comment to help a fellow bro
@zohahs52762 жыл бұрын
nice one can you please also mention link to the complete playlist to which this video belongs its hard to find the playlist where I can check out other videos. I will add one like for the youtube prayer algo now thanks.
@phamducphutrong2 жыл бұрын
Why youtube does not provide the ability to help viewer knows which playlist that the currently video belongs to? I must see the code inside the video and see the hastag name to guess the playlist while the author have added that video into specefic playlist!
@kristheog85462 жыл бұрын
Hi sir, are you planning to make a tutorial for Lua language? thanks in advance
@nicolewynne47812 жыл бұрын
please could you do PHP full course bro? love you brooo
@hamidgholami26832 жыл бұрын
Hello bro what do you think about chat gpt? will it replace devs?!