Learn RECURSION in 5 minutes! 😵

  Рет қаралды 175,044

Bro Code

Bro Code

Күн бұрын

Пікірлер: 169
@BroCodez
@BroCodez Жыл бұрын
# 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))
@ЙирюВонаирда
@ЙирюВонаирда Жыл бұрын
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
@captainhostile101 Жыл бұрын
@@ЙирюВонаирда i sure need em for tomorrows exam
@OceanLover8008
@OceanLover8008 Жыл бұрын
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'. 😎
@BroCodez
@BroCodez Жыл бұрын
thanks for watching 😎
@randymartin9040
@randymartin9040 2 ай бұрын
This taught me something about the stack and how code functions that I haven't learned from anywhere else, invaluable. Thank you! Blessings.
@Loco4Waffles
@Loco4Waffles 7 ай бұрын
Best example I have seen on explaining recursion
@zabehullahalizadeh2310
@zabehullahalizadeh2310 Жыл бұрын
Learn python with Bro is as enjoyable as playing our favorite games
@mihailomilenkovic6382
@mihailomilenkovic6382 Жыл бұрын
True
@salihmorta4172
@salihmorta4172 9 ай бұрын
This is the best BEST explanation for recursion I’ve ever heard
@itayzabar2953
@itayzabar2953 Жыл бұрын
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!
@edipedipbulmaz
@edipedipbulmaz Жыл бұрын
I just wanted to thank you. For teaching me programming and starting my coding career. Tanks again.
@abdulhannan-18
@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
@ssmith5048
@ssmith5048 Жыл бұрын
Excellent explanation and examples!
@farhisoki4805
@farhisoki4805 Күн бұрын
Help a lot, thanks
@randymartin9040
@randymartin9040 2 ай бұрын
Cool way of understanding this, thank you.
@MalaPalabra-zr6wg
@MalaPalabra-zr6wg Жыл бұрын
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.
@chrisogonas
@chrisogonas 3 ай бұрын
Very well illustrated! Thanks
@anshhmalviyaa
@anshhmalviyaa Жыл бұрын
Best channel for learning to program on KZbin. ❤
@eddisonlewis8099
@eddisonlewis8099 Жыл бұрын
Very interesting illustration
@fluffyisyermom7631
@fluffyisyermom7631 10 ай бұрын
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 😂
@OllyCybSec
@OllyCybSec 6 ай бұрын
Thank You and Salute to @Bro Code‼️. I watched the entire 106 video playlist of Python. Brilliantly demonstrated and explained. 🏆🏆🏆
@tictactechin
@tictactechin Жыл бұрын
from this video i learn that programming is solving your own error code problem while trying to achieve your goal code
@Wolfoffreedom111
@Wolfoffreedom111 Жыл бұрын
Great 👍
@audiemolinger6450
@audiemolinger6450 6 ай бұрын
Great course, great instructor
@shoukatiqbal5674
@shoukatiqbal5674 25 күн бұрын
very impressive demonstration well done Sir
@recursion.
@recursion. 5 күн бұрын
Good to see so many people interested in me🥰🥰🥰
@flashplaysyt5719
@flashplaysyt5719 Жыл бұрын
It is seems very essy to learn with you thanks for making videos
@kristijanlazarev
@kristijanlazarev 9 ай бұрын
Finished in a less than a week, even though I work a full time job, very good course!
@Daniyar-AbuUmar
@Daniyar-AbuUmar Жыл бұрын
Subscribed and liked without even thinking twice
@bryce3851
@bryce3851 6 ай бұрын
This has showed me the important part for data analysis thanks bro 🙏
@ZyrusAlvez
@ZyrusAlvez 8 ай бұрын
Thank you. No one told me that the best way to understand recursion is first understanding the stack
@Geniuspaul-Projects
@Geniuspaul-Projects Жыл бұрын
thanks allot for your help
@kadirv
@kadirv 8 ай бұрын
excellent. well clarified 👏👏
@hxhchimeraantarc2268
@hxhchimeraantarc2268 Жыл бұрын
I am studying for finals right now and your videos are the best. You are so good at explaining. Thank you so much.
@fredcunningham8049
@fredcunningham8049 10 ай бұрын
Great tut, thanks!
@poi9696
@poi9696 2 ай бұрын
✨✨
@onter
@onter 6 ай бұрын
really well explained, good stuff
@rockey5508
@rockey5508 Жыл бұрын
I'm glad I found Bro Code, I'm still learning but Bro Code makes coding easy to learn.
@abhisaragarwal9084
@abhisaragarwal9084 Жыл бұрын
Sir your videos are very good thnx for uploading programming language tutorials for free.
@TheKr0ckeR
@TheKr0ckeR 7 ай бұрын
For 1 year later, learning 8 min tutorial decreased to 5 min. :D Thanks for the tutorial
@Simonjoel-469
@Simonjoel-469 5 ай бұрын
I really enjoyed watching your videos but I think you should share your resources pls...!!
@abdulhannan-18
@abdulhannan-18 Жыл бұрын
def walk(steps): if steps == 0: return walk(steps - 1) print(steps) walk(18) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
@sirwinkiebinkie8270
@sirwinkiebinkie8270 11 ай бұрын
You should add a positive only condition for the factorial in the recursice function :)
@Nishitha_Jay
@Nishitha_Jay 7 ай бұрын
Thanks alot for this my Bro. You are a true BRO. ❤
@informativecontent4778
@informativecontent4778 3 күн бұрын
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)
@EmilioAt77
@EmilioAt77 3 ай бұрын
As always, you are the best, Bro 🤝🏻🤝🏻
@杨玄-v4k
@杨玄-v4k 10 ай бұрын
really helpful thanks bro
@tigerli2262
@tigerli2262 8 ай бұрын
love it
@sinankodur4251
@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
@yashvashist5347
@yashvashist5347 Жыл бұрын
Thanks bro❤️✨
@harley_randelo
@harley_randelo Жыл бұрын
great video. thanks for uploading. and btw, first
@calmlivingclub
@calmlivingclub Жыл бұрын
Great sharing
@julia-kc3kp
@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!
@malvernmabvira1562
@malvernmabvira1562 Жыл бұрын
1:47 no brackets to define scope of a function. Java for me.
@marshmelows
@marshmelows Жыл бұрын
I'm amazed how the recursive approach tends to be simpler to write. Thanks Bro Code!
@sweet_coconut
@sweet_coconut Жыл бұрын
thank you! now recursion is a bit clearer to me :)
@Vue-daigle
@Vue-daigle Жыл бұрын
Hi Bro, thanks for all the work you've put into these tutorials.
@keldur16
@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.
@realitybeckons4120
@realitybeckons4120 Жыл бұрын
Thank you
@BlountForceTrauma
@BlountForceTrauma 9 ай бұрын
Thank you!
@piotrkopcewicz5227
@piotrkopcewicz5227 Жыл бұрын
great as usual !! thanks
@induminidilukshaWijesinghe
@induminidilukshaWijesinghe Жыл бұрын
Mah bro , Thanks a bunch ❤️💐
@abdulhannan-18
@abdulhannan-18 Жыл бұрын
def walk(steps): for step in range(1, steps+1): print(step, end=" ") walk(18) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
@salamvip7145
@salamvip7145 Жыл бұрын
👍 Good
@RexMan04
@RexMan04 11 ай бұрын
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!
@francescodiniccolo
@francescodiniccolo 3 ай бұрын
Thanks Bro, that was a great explanation Bro
@SoundKing
@SoundKing Жыл бұрын
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?
@AntonSobolev
@AntonSobolev Жыл бұрын
nice
@OBGCORP
@OBGCORP Жыл бұрын
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...
@SeanPatrickGo
@SeanPatrickGo Ай бұрын
Thanks Bro! This video really helped!
@codecaine
@codecaine Жыл бұрын
Keep up the excellent work
@arsacode6145
@arsacode6145 Жыл бұрын
you're doing gods work, bro
@prizepig
@prizepig Жыл бұрын
Just when I thought I was out, they pulled me back in.
@tilkesh
@tilkesh Жыл бұрын
Thx
@GhostGaming-tt9tu
@GhostGaming-tt9tu 9 күн бұрын
You are a legend
@mdayubali9751
@mdayubali9751 Жыл бұрын
could you please make devops or aws videos please......!
@AlexTerrable
@AlexTerrable Жыл бұрын
Thanks bro
@rishusingh1995
@rishusingh1995 9 ай бұрын
BROOO!! Finally I understand recursion 😂
@Osamu_GWAD
@Osamu_GWAD Жыл бұрын
Good job!!! 🤝
@ohChardy
@ohChardy 5 ай бұрын
last video of the playlist
@AayushBashyal1
@AayushBashyal1 4 ай бұрын
was it worth the watch?
@AbelBen-fz6hs
@AbelBen-fz6hs 6 ай бұрын
sick video dog. got 89% for my test just from this video
@sohelqureshi4183
@sohelqureshi4183 Жыл бұрын
Sir you're can Please make video for django python course or playlist
@MarcosBilly-x7y
@MarcosBilly-x7y 11 ай бұрын
cool video)
@nik4465
@nik4465 Жыл бұрын
Thank you, Bro😎
@zohahs5276
@zohahs5276 Жыл бұрын
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.
@BüblySnowfláke-m3x
@BüblySnowfláke-m3x 6 ай бұрын
Who's watching dis in 2024,love all ur tutorials bro❤
@FaraDuMatin
@FaraDuMatin Жыл бұрын
Bruh I just saw that in class on week ago and didn’t understood shit. You are a wizard my guy.
@QhY-j2e
@QhY-j2e 4 ай бұрын
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
@ThomasC-e8i 13 күн бұрын
do you understand now?
@Jess-xg7ok
@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!
@hamidgholami2683
@hamidgholami2683 Жыл бұрын
Hello bro what do you think about chat gpt? will it replace devs?!
@Mario-xk7kh
@Mario-xk7kh 10 ай бұрын
Ohhhhhhh, I get it now. Oh my gosh I was going through this in Data Structures today and I was lost. I understand better mow
@codeplays5672
@codeplays5672 2 ай бұрын
what is the sequence the code will go if there is more than one code calling back the function within the function?
@geerliglecluse5297
@geerliglecluse5297 11 ай бұрын
Not going to say I really get it after only watching this video, I'm not that smart. But I do understand that's it's worth diving deeper into this.
@Vue-daigle
@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. (=
@pankela8883
@pankela8883 Жыл бұрын
Hey Bro I really appreciate your work, right now I m struggling to import the java library JCap can you guide me trought it?
@heinrichsmit2
@heinrichsmit2 Жыл бұрын
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.
@phamducphutrong
@phamducphutrong Жыл бұрын
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!
@ameyagupta7285
@ameyagupta7285 Жыл бұрын
tysm!
@tjbennett1266
@tjbennett1266 15 күн бұрын
Word
@maxim1308
@maxim1308 Жыл бұрын
Why are numbers in the output of walk function reversed?
@rubayetulalam1126
@rubayetulalam1126 10 ай бұрын
why print (f'you take step #{steps}') works upward while using after recursive function call?
@nxthingbutv0id958
@nxthingbutv0id958 Жыл бұрын
I’m the future, please do a series on rust
@kristheog8546
@kristheog8546 Жыл бұрын
Hi sir, are you planning to make a tutorial for Lua language? thanks in advance
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
C_104 Recursion in C | Introduction to Recursion
18:51
Jenny's Lectures CS IT
Рет қаралды 443 М.
Каха и лужа  #непосредственнокаха
00:15
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 25 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 13 МЛН
COMPUTER SCIENCE explained in 17 Minutes
16:49
Wacky Science
Рет қаралды 1,4 МЛН
How to trace Recursion? Eg1 Stack Method
6:45
Cis Theta Learning
Рет қаралды 112
Recursion in Java Full Tutorial - How to Create Recursive Methods
11:11
Coding with John
Рет қаралды 268 М.
This is a Better Way to Understand Recursion
4:03
Alex Hyett
Рет қаралды 59 М.
C++ recursion explained easy 😵
6:21
Bro Code
Рет қаралды 15 М.
You WILL Understand Recursion After Watching This
3:46
What is recursion and when should I use it?
15:34
Eric Normand
Рет қаралды 2,4 М.
Learn Data Structures and Algorithms for free 📈
4:00:15
Bro Code
Рет қаралды 1,8 МЛН
Каха и лужа  #непосредственнокаха
00:15