Recursion Java Tutorial #69

Поделиться
HTML-код
  • Опубликовано: 20 янв 2025

Комментарии • 282

  • @alexlorenlee
    @alexlorenlee  Год назад +3

    If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h

  • @evinhendry3560
    @evinhendry3560 4 года назад +370

    Universities, pay to use websites, overpriced textbooks, Udemy courses, exclusive courses: People have to pay hundreds or thousands of dollars to learn even basic Java and it's going to be several long years of study to even get past the introductory phases.
    Alex Lee: Hold my beer.

    • @alexlorenlee
      @alexlorenlee  4 года назад +34

      Evin Hendry :)

    • @thaminduKavinda
      @thaminduKavinda 4 года назад +5

      That's True

    • @cyclingroutesSCOTLAND
      @cyclingroutesSCOTLAND 4 года назад

      So would you be a patron for him?

    • @mrboyban
      @mrboyban 4 года назад +8

      Tell me..... Enrolled this so called top 30th best CS universities in the world. So disappointed tubes of money thrown at it and all you get back is self-study. Capitalism just turned to be a piss taken.

    • @ninjaninja9954
      @ninjaninja9954 3 года назад +1

      This is good as an intro but not good enough for an exam question or interview. You may feel you get it but now write a fibonacci sequence and see if you can do that i bet you can't

  • @FunnyDubz1
    @FunnyDubz1 4 года назад +116

    You're so enthusiastic and you never make me feel bored while learning how to code! I usually don't comment on videos but you sure deserve it!

  • @tommieogrady
    @tommieogrady 5 лет назад +163

    I 've tried and seen a lot of java tutorials both free on utube and others you have to pay for. Without doubt these are the best by a long shot.

    • @_________________404
      @_________________404 4 года назад +1

      Well yeah, this tutorial is not bad, but it's definitely made for "java beginners". For example, when the StackOverflow exception appears he saids that "The computer can't handle it" which is wrong because the computer can handle it, it's just the program stack being overflown. Program stack size is the limitation, not the computer hardware..

    • @joeatefabdullah4095
      @joeatefabdullah4095 4 года назад +3

      @@_________________404 okay wow, computer genius.... bet you cant explain as good as this guy over here

    • @_________________404
      @_________________404 4 года назад +2

      @@joeatefabdullah4095 Well no, I'm not saying that he's wrong. When I was learning about recursion, it was important for me to understand how the program stack works, because it then all makes sense. He ignored the topic of program stack in this video in order to make it more beginner friendly, but I'd say that it's very important to understand how the program stack works if you want to fully understand recursion.

    • @_________________404
      @_________________404 4 года назад +2

      Error Yeah sure, I don’t give a fuck about 5 month old comment anyway.

    • @luisishere987
      @luisishere987 3 года назад

      jonasxdufek you say that but you took time out of your day to reply lmao

  • @harryghotra7784
    @harryghotra7784 5 лет назад +235

    dude your such a good teacher literally saving me for my exam!!!!

    • @sebastiendemonty960
      @sebastiendemonty960 3 года назад

      that is true. he is the best teacher ever!

    • @sebastiendemonty960
      @sebastiendemonty960 3 года назад +2

      that is true. he is the best teacher ever!

    • @ValoFranceClips
      @ValoFranceClips 2 года назад

      How can it save your exams... If u dont even know that hat are u doing here in this university ?? People are not even working alone by themselves today...

    • @midnight4569
      @midnight4569 2 года назад +5

      @@ValoFranceClips Everyone learns differently and at different speeds. Some people can figure things out by themselves just fine, and other people learn better when something is explained to them by someone else in a certain way. Just because someone learns differently from you doesn't make them stupid or incapable of becoming a programmer. The fact that they're here trying to learn instead of asking for a classmate's code to turn in is actually a really great sign imo.

    • @erereeerefgdg
      @erereeerefgdg Год назад +1

      @@ValoFranceClips 10/10 English

  • @evnoww
    @evnoww 4 года назад +40

    Thank you so much! you managed to make two 2hr classes make sense in 9mins ! life saver

    • @Zinab8850
      @Zinab8850 3 года назад +1

      Did your teacher take 2 hours to explain recursion?

    • @icey_john
      @icey_john 2 года назад +1

      @@Zinab8850 my teacher can't explain recursion

    • @life-tech-talks
      @life-tech-talks 2 года назад

      @@icey_john 🤣🤣

  • @DoNotBeAnNPC
    @DoNotBeAnNPC 5 лет назад +27

    I absolutely love all of your videos!! You go straight to the point and explain in a way anyone can easily understand. It removes the fear in me when I start coding
    Congrats on your 10k! Next stop, 100k!!

  • @flyetimadtravel2157
    @flyetimadtravel2157 4 года назад +3

    I started learning coding after Corona virus Pandemic and I will say this is best channel to learn java.
    Thank You

  • @Joe-km7xi
    @Joe-km7xi 5 лет назад +8

    5:38 explanation is SO helpful and makes it much easier to understand. Love the videos man :)

  • @gravity_gaming_01
    @gravity_gaming_01 11 месяцев назад

    You're so enthusiastic and you never make me feel bored while learning how to code! I usually don't comment on videos but you sure deserve it!

  • @ashuumudunuri3760
    @ashuumudunuri3760 3 года назад +2

    recursion were a nightmare ..but after this video it has become day dream
    ps:btw ur flips r great...good progress

  • @eliseziemer4145
    @eliseziemer4145 3 года назад +5

    You broke recursion down so well that I understood on the first try. Thank you so much!!

  • @GoodGirl880302
    @GoodGirl880302 3 года назад +1

    I find your Java tutorials very helpful. I'm sorry you have stopped making them. Wish you the best :)

  • @joshuajamescalba
    @joshuajamescalba 4 года назад +1

    I watched this video the day before my exam, and I got a question about how to make recursion on my exam. This video really helped me boost up my grades, thank you, Alex, for this video tutorial, I appreciate this so much, it's such a blessing

  • @humawaseem576
    @humawaseem576 4 года назад +4

    man this is so clear , thank you!!! please keep making these easy videos for people like us.

  • @paulburger330
    @paulburger330 4 года назад

    Once again your tutorials save me, right before I start drowning in the Universities confusion. Thank you for your tutorials!!!

  • @v3dantsharma
    @v3dantsharma 4 года назад

    Dude I can't thank you enough for making DSA so easy and understandable for me. I recommend your channel to every person if they ask me something related to java programming. God bless you and I wish that you get a million subs very soon :D

  • @iamali9293
    @iamali9293 5 лет назад +1

    this is the best java tutorial I've seen. I watch you from Iran.

  • @amitdhawan579
    @amitdhawan579 4 года назад

    Your way definitely simplified it for me. Other teachers are teaching it in reverse where the last method invoked exits first. With your explanation, that way is also easier for me to wrap my head around. Good job man.

  • @jayhowes847
    @jayhowes847 5 лет назад +4

    Thankyou so much for actually explaining why things have to go where they go! Watched 5 videos before this that didn't help. Yours got me to the right answer, thanks again!

  • @rittenbrake1613
    @rittenbrake1613 4 года назад

    I love how you explain the if statement, decrement loop, its super clear and easy to understand

  • @timothybritcliffe
    @timothybritcliffe 2 года назад

    Thank you so much, I have a Java exam in a week and my prof cancelled all of the classes we were supposed to discuss recursion. The notes for lack of a better term were stupid. This video definitely cleared up recursion :D

  • @Pheyden
    @Pheyden 3 года назад +1

    I've learned more in a week of watching your videos than in my entire Beginning Programming semester. Thanks.

  • @jadesimonson8253
    @jadesimonson8253 4 года назад +1

    Reigniting my fire to keep learning to code when I get stuck! Thank you so much for all of these videos!

  • @365motivation.9
    @365motivation.9 2 года назад

    Dude your video is super easy to understand the concept of recursion.Thank you Mann!.Can wait to watch more of your video.

  • @gilsonmirandajunior5505
    @gilsonmirandajunior5505 3 года назад

    I'm addicted to your channel. The past week I was struggling with recursion. However, since I started your playlist, it became expressive easier to fill my gaps and fully understand it. Thank you!

  • @billfuentes7989
    @billfuentes7989 11 месяцев назад

    THANK YOU! In 9 minutes you helped me understand the 18th chapter of my textbook! Thanks Again!

  • @kryptic7952
    @kryptic7952 2 года назад

    This has helped a lot, especially since I have an AP exam coming up and I have been struggling with recursion for the longest time

  • @JamesJohnson-sv4cp
    @JamesJohnson-sv4cp Год назад

    BEST CHANNEL ON RUclips HELEPED SO MUCH FOR MY JAVA EXAM

  • @frozen_waffle1688
    @frozen_waffle1688 5 лет назад +32

    Awesome! You deserve more credit for this!

  • @cristianjeffries
    @cristianjeffries 3 года назад

    Hope everything's going well dude. I find myself coming back to your channel over and over whenever I'm having issues understanding a certain topic in my CSE classes. Thank you so much for making these videos.. You are truly a gift!

  • @its2467
    @its2467 3 года назад

    You are an actual life saver man, a god send. I should just set all of your videos on autoplay and take notes on that rather than watching the brain numbing, poorly thought out lectures that my teachers are dumping on me.

  • @theresafischer7005
    @theresafischer7005 3 года назад +1

    Hey Alex! I love your tutorials! Because you explain everything from bottom up and tell us WHY you're doing WHAT

  • @drishyanair15
    @drishyanair15 4 года назад

    I don’t really leave comments but I have to on this video because this tutorial is the only thing that has helped me learn recursion. Thank you so much!

  • @ericchu6503
    @ericchu6503 5 лет назад +4

    I know I can always rely on your videos for a top notch explanation!

  • @niranz7745
    @niranz7745 4 года назад

    Absolutely amazing. Your tutorials are the best. Your channel should have way more subscribers and you're giving me inspiration not only with programming, but also with your teaching attitude. Keep creating amazing contact!

  • @Nafesah13
    @Nafesah13 4 года назад

    Finished Playlist one and playlist two of Java basics, now on to intermediate Java. Thank you for engaging with the audience and being so relatable. I am in fond of your teaching and I must say your my Java Guru. Love your videos and thank you for making impact in my life on my journey to becoming a programmer. Lots of love from New York City!

  • @bart_981
    @bart_981 4 года назад

    Same story for me, got the explanation in school, but really understood it after watching this tutorial. Great work!

  • @rittenbrake1613
    @rittenbrake1613 4 года назад +6

    2:41 "it seems like we got a brunch of hi s" 😂It sounds funny, I hope that's my social life be like

  • @anandchaudhary8952
    @anandchaudhary8952 3 года назад

    I'm just happy that I watched this video before I started reading recursion chapter. My books starts off recursion with factorial example followed by Fibonacci sequence and then Sierpinski triangle pattern and many more complex stuff like tower of Hanoi tower problem, etc..🤯 Very good into. Thanks! Don't you say that you are gonna stop teaching again Alex. We need you.

  • @riamatapurkar6844
    @riamatapurkar6844 4 года назад

    Ohmigod this is brilliant, after watching your video something clicked and I'm actually understanding everything now

  • @AwsmAyumiiKa
    @AwsmAyumiiKa 2 года назад +1

    Started my second semester this March and I am so, so, so thankful for all of your videos! 😭 I had to miss a lot of lessons in programming last semester since I've got sick for a couple of weeks and couldn't catch up on everything (and still struggle because of it)
    But your explanations are great, they're short so my ADHD brain stays focused, your examples are great, and my frustration (and anxiety) stays low. 🙈
    Programming is fun and your videos do help me to maintain this mindset and keep trying 💪🏻

  • @inspireal3122
    @inspireal3122 4 года назад

    I dont know if you wil read this, but thank you! Very easy to understand and makes me like Java. It looks so hard when someone doesnt know how to explain it.

  • @squiggzzz
    @squiggzzz 3 года назад

    This is an absolute must watch to understand recursion. Fantastic video Alex. Love your content.

  • @kurtstevenlaxamana3193
    @kurtstevenlaxamana3193 Год назад

    Came across the same topic in w3schools but find the example difficult to understand so I ended up here which is fantastic because everything was well explained and easy to understand. Thanks a lot and keep it up in sharing your knowledge!

  • @jinju3785
    @jinju3785 4 года назад

    Thanks Alex 👍 its been my 7th visit in your channel reallt help dude thanks 😊

  • @eugeniagiouzakova9573
    @eugeniagiouzakova9573 4 года назад

    Thanks a lot! I've tried to understand how exactly the recursion works for 2 days.. you've explained it in less than 10 minutes! Like and subscription!

  • @jennclark9016
    @jennclark9016 3 года назад

    You are making a HUGE difference for me while I work through second year comsci

  • @mohamedzindha2850
    @mohamedzindha2850 4 года назад +1

    I am so glad I found this video, you saved me a lot of time.

  • @leoulfitness
    @leoulfitness 3 года назад +1

    Keep doing what you are doing Alex! These videos are truly helping me out immensely!

  • @carlosdanielmarquez6693
    @carlosdanielmarquez6693 2 года назад

    I always come first to your training to understand it. You are very talented and make it easy for the rest of us to learn the concepts.

  • @benjamincarter3608
    @benjamincarter3608 3 года назад

    Exactly the video I needed. I can't believe free code camp tried to explain this in a few simple sentences. This makes perfect sense after watching your video on it. Thanks a ton.

  • @blisscrazyfangirl
    @blisscrazyfangirl 4 года назад

    Thanks for giving the tutorial given from ur side. I am now slowly learning for my final year project. Really appreciate it!!!

  • @sylwesteroleszek3143
    @sylwesteroleszek3143 4 года назад

    The best explanation of the recursion on youtube :-)
    Thanks a lot!

  • @eliyahomar
    @eliyahomar 4 года назад +2

    you are unbelievable, Thank you so much for making things such simple to understand

  • @afghangirl2758
    @afghangirl2758 2 года назад

    You are the best programming teacher I have ever seen you're perfect 👍☺️

  • @bon78
    @bon78 4 года назад

    this is actually very very helpful! thank you so so much! the explanation is much clearer than any other websites i find online and the examples are perfect!

  • @meat_kid
    @meat_kid 4 года назад

    Alex you are my savior. I might actually pass my data structures class now

  • @davidmathieu681
    @davidmathieu681 2 года назад

    I really like the way you teach, always very smooth and clear.

  • @valsant4
    @valsant4 5 лет назад +2

    by far the most helpul videos. thank you alex for making this so simple :')

  • @adityakarmaker8805
    @adityakarmaker8805 4 года назад

    You're honestly such a lifesaver man thank you so much for this.

  • @lilybohr
    @lilybohr 2 года назад

    This video saved me in my java class. Recursion seemed so confusing until now.

  • @ZauriaTaylor-z4i
    @ZauriaTaylor-z4i Год назад

    I genuinely thought I would never understand this omg thank you !! :'D

  • @arianaaa2469
    @arianaaa2469 4 года назад

    thanks you really helped me out for my exam! definetly subscribed! greetings from Bavaria, Germany :)

  • @onpointinsight
    @onpointinsight 3 года назад

    Thank you soooo much. Recursion isn't my fav topic but you made it soo simple for me. I'll surely share this knowledge!

  • @MULTIFACEPLANTER
    @MULTIFACEPLANTER 4 года назад +7

    5:39 - "So here's what's happening..." then proceeds to explain to me that content that my lecturers couldn't in 2 months of classes in about 40 seconds.

    • @bon78
      @bon78 4 года назад

      IKR???

  • @feruzka_2017
    @feruzka_2017 27 дней назад

    In first example code has potential bug, in base case you are checking if n==0, but if user will pass negative number when calling the method recursive method will keep executing that causes again StacjOverflow exception. To avoid these type of edge cases better to pass if(n

  • @vimalaangelus1052
    @vimalaangelus1052 4 года назад

    Alex you are awesome making it more friendly and easy to.understand .thank you

  • @premiuminternational9367
    @premiuminternational9367 5 лет назад

    Clear, Crystal and excellent explanation.

  • @Cablur
    @Cablur 4 года назад

    Yet another very great video, easy to understand :) Thank you so much !

  • @InSterquiliniisInvenitur
    @InSterquiliniisInvenitur 4 года назад

    Okay this was super helpful. Thanks for the lesson!

  • @akhabalasi6252
    @akhabalasi6252 2 года назад

    Thankyouu bruh, this mean a lot for me. keep spirit make a lot of Java tutorial, we all love this

  • @howellpendragon2227
    @howellpendragon2227 4 года назад

    You had helped me out twice now, its hard learn programming through printed module

  • @moosematrix
    @moosematrix 2 года назад

    Alex you literally have been so helpful. Thank you so much!

  • @frenchtouch8814
    @frenchtouch8814 4 года назад

    I just wanted to let you know that I thought bucky was the best programmer in youtube but not until I discovered you, you make programming with a heart, interesting, fun and amazing. I look up into you! uhmm Keep going and stay awesome!

  • @rajatsemwal1865
    @rajatsemwal1865 4 года назад +2

    Damn! That was smooth AF...

  • @hamidarenabdi9611
    @hamidarenabdi9611 4 года назад

    I really enjoyed the method you taught. thanks man

  • @hubbeislam9263
    @hubbeislam9263 4 года назад

    thanks bro normally after every 2-3days of programming i feel it very difficult even those concepts which i already covered.Then when i am worried i watch your tutorials and there it is i got it ,again, thank you so much.TRUST ME I AM NOT BUTTERING😂😂😂😂😂😂.keep it up. if i speak specificially i was confused that what is recursion(offcourse a nightmare) but now i have an idea of what is it thanks again and keep it up again😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂

  • @sarinestephens4593
    @sarinestephens4593 2 года назад

    Thank you so much, you literally just saved me for my final tomorrow!!

  • @OSAMA-xn1zm
    @OSAMA-xn1zm 4 года назад

    Thanks Alex you’ve helped me a lot ❤️

  • @bipindutta2967
    @bipindutta2967 3 года назад

    Excellent explanation about recursion. Thanks a ton!

  • @EXPANDROIDGAMES
    @EXPANDROIDGAMES Год назад

    Bro is a very good teacher!

  • @georgejuarez1028
    @georgejuarez1028 4 года назад

    Alex Lee you are my hero.

  • @richardofredemption
    @richardofredemption 2 года назад

    Life saver as usual Alex. Thank you!

  • @oliverstivers5967
    @oliverstivers5967 3 года назад +1

    So, I noticed that all of the examples in this video could easily be done with a for loop instead. What are the advantages, if any, of using recursion, as opposed to a for loop?

  • @vansh9857
    @vansh9857 2 года назад

    So clearly explained, Thank you so much!

  • @d.n.ctalop5560
    @d.n.ctalop5560 4 года назад +1

    Can you use the for statement instead?
    Btw love your videos

  • @joethompson8147
    @joethompson8147 3 года назад

    fantastic explanation of recursion. If you see recursion being taught with "Fibonacci sequence "as the first illustration, forget that and use the 2 examples here.

  • @DavidBartenstein
    @DavidBartenstein 3 года назад

    Hi Alex, could you please explain why the recursion stops after hitting the basecase instead of just infinitely printing out "Done!"?... I would think that the method would keep calling itself unless specificly asked to snap out of it?

  • @blueballedtech
    @blueballedtech 3 года назад

    Oh, this is an excellent breakdown of an oftentimes tricky subject for many(like myself).

  • @hrtghrtfgref2679
    @hrtghrtfgref2679 2 года назад

    thank you! you always helps me! keep the good work!

  • @dean_sand0620
    @dean_sand0620 3 года назад

    you're helping me a lot, thanks man!

  • @nastikapp
    @nastikapp 2 года назад

    Thank you Alex! Very helpful!

  • @allenchen4112
    @allenchen4112 4 года назад

    clear and crystal, thank you so much!

  • @jagadishkadraka8644
    @jagadishkadraka8644 3 года назад

    I was reading the book and like wth! Thanks for the explanation.

  • @KristinaRRiney
    @KristinaRRiney 5 лет назад

    You, sir, deserve my professor's paycheck

  • @KiraSantosRandom4Life
    @KiraSantosRandom4Life 4 года назад

    Thank you. Learning java with this and Caleb.

  • @Believer1995ofGod
    @Believer1995ofGod 3 года назад

    For some reason my "done" statement keeps priting at the top but it should print at the bottom?

  • @dhruvbhumbla4396
    @dhruvbhumbla4396 Год назад

    bro thank you this made a lot of sense

  • @zOriginYT
    @zOriginYT 4 года назад

    How would you use a recursive method involving boolean values? Like checking if a palindrome is true or false as an example.