Java Recursion

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 339

  • @derekbanas
    @derekbanas  Před 5 lety +7

    Learn in One Videos for Every Programming Language
    Subscribe to Bookmark them: bit.ly/2FWQZTx
    C++ : czcams.com/video/Rub-JsjMhWY/video.html
    Python : czcams.com/video/N4mEzFDjqtA/video.html
    Java : czcams.com/video/n-xAqcBCws4/video.html
    PHP : czcams.com/video/7TF00hJI78Y/video.html
    MySQL : czcams.com/video/yPu6qV5byu4/video.html
    JavaScript : czcams.com/video/fju9ii8YsGs/video.html
    C# : czcams.com/video/lisiwUZJXqQ/video.html
    HTML5 : czcams.com/video/kDyJN7qQETA/video.html
    CSS3 : czcams.com/video/CUxH_rWSI1k/video.html
    JQuery : czcams.com/video/BWXggB-T1jQ/video.html
    TypeScript : czcams.com/video/-PR_XqW9JJU/video.html
    ECMAScript : czcams.com/video/Jakoi0G8lBg/video.html
    Swift : czcams.com/video/dKaojOZ-az8/video.html
    R : czcams.com/video/s3FozVfd7q4/video.html
    Haskell : czcams.com/video/02_H3LjqMr8/video.html
    Handlebars : czcams.com/video/4HuAnM6b2d8/video.html
    Bootstrap : czcams.com/video/gqOEoUR5RHg/video.html
    Rust : czcams.com/video/U1EFgCNLDB8/video.html
    Matlab : czcams.com/video/NSSTkkKRabI/video.html
    Arduino : czcams.com/video/QO_Jlz1qpDw/video.html
    Crystal : czcams.com/video/DxFP-Wjqtsc/video.html
    Emacs : czcams.com/video/Iagbv974GlQ/video.html
    Clojure : czcams.com/video/ciGyHkDuPAE/video.html
    Shell : czcams.com/video/hwrnmQumtPw/video.html
    Perl : czcams.com/video/WEghIXs8F6c/video.html
    Perl6 : czcams.com/video/l0zPwhgWTgM/video.html
    Elixir : czcams.com/video/pBNOavRoNL0/video.html
    D : czcams.com/video/rwZFTnf9bDU/video.html
    Fortran : czcams.com/video/__2UgFNYgf8/video.html
    LaTeX : czcams.com/video/VhmkLrOjLsw/video.html
    F# : czcams.com/video/c7eNDJN758U/video.html
    Kotlin : czcams.com/video/H_oGi8uuDpA/video.html
    Erlang : czcams.com/video/IEhwc2q1zG4/video.html
    Groovy : czcams.com/video/B98jc8hdu9g/video.html
    Scala : czcams.com/video/DzFt0YkZo8M/video.html
    Lua : czcams.com/video/iMacxZQMPXs/video.html
    Ruby : czcams.com/video/Dji9ALCgfpM/video.html
    Go : czcams.com/video/CF9S4QZuV30/video.html
    Objective C : czcams.com/video/5esQqZIJ83g/video.html
    Prolog : czcams.com/video/SykxWpFwMGs/video.html
    LISP : czcams.com/video/ymSq4wHrqyU/video.html
    Express : czcams.com/video/xDCKcNBFsuI/video.html
    Jade : czcams.com/video/l5AXcXAP4r8/video.html
    Sass : czcams.com/video/wz3kElLbEHE/video.html

  • @elicompton5122
    @elicompton5122 Před 6 lety +329

    In order to understand recursion, you must first understand recursion

    • @derekbanas
      @derekbanas  Před 6 lety +15

      That's funny :)

    • @anugrahgeorge8293
      @anugrahgeorge8293 Před 4 lety +18

      No. In order to to understand recursion, you must first understand recursion. In order to understand recursion, you must first understand recursion
      .In order to understand recursion, you must first understand recursion
      . In order to understand recursion, you must first understand recursion
      .
      .
      .
      .
      .
      .
      .
      Constant loop

    • @ExarchiasGhost
      @ExarchiasGhost Před 4 lety +3

      @@anugrahgeorge8293 do you mean recursion?

    • @anugrahgeorge8293
      @anugrahgeorge8293 Před 4 lety +6

      @@ExarchiasGhost yes but in order to understand what u asked...U need to ask urself what is recursion. Then understand recursion. Then understand recursion. Then understand recursion. *bloody loop*

    • @ExarchiasGhost
      @ExarchiasGhost Před 4 lety +1

      @@anugrahgeorge8293 ok but I will start from the recursion because when I tried with recursion I got results from a recursion. :)

  • @daniels6824
    @daniels6824 Před 10 lety +143

    I spent 3 semesters in computer science courses avoiding recursion like the plague. I have had only excellent teachers, but never nailed down the nuances that kept recursion confusing. Here I am, at 4 am the night before my final and you absolutely nailed it (it was the going back up concept, among other things). Progressing in this field can be difficult, and I am very thankful for your tutorials. You must love what you do!

    • @derekbanas
      @derekbanas  Před 10 lety +24

      I absolutely love programming :) I'm very happy that I was able to clear up a very often confusing topic. That is always the goal of each video.

    • @yankomirov4290
      @yankomirov4290 Před 5 lety +10

      Where are you working now, after 4 years?

    • @atift5465
      @atift5465 Před 5 lety

      This was an amazing explanation! Im right there with you!

  • @howchen8529
    @howchen8529 Před 5 lety +51

    I spent so long on the first recursive function thinking he passed in 1.6

  • @derekbanas
    @derekbanas  Před 11 lety +2

    Thank you :) Im very happy I was able to help. I worked as a programming architect for many years and one of my responsibilities was to train new hires. I always enjoyed doing that. While making these videos I imagine someone is standing behind me and learning. It makes me very happy to be able to help

  • @derekbanas
    @derekbanas  Před 11 lety +1

    I'm extremely grateful to be able to help in what ever way I can. Thankfully there are thousands of people that love to teach and that number will continue to grow. Eventually a complete education on every topic will be available for free to all across the globe.

  • @derekbanas
    @derekbanas  Před 11 lety

    Ich bin froh, es hat euch gefallen. Ich hoffe, ich machte es leicht, in diesem Video zu verstehen? Ich liebe es, komplizierte Themen leicht zu verstehen. Vielen Dank für immer die Zeit nehmen, um Sie wie die Videos sagen. Ich schätze, dass :)

  • @derekbanas
    @derekbanas  Před 11 lety +1

    I have been programming for over 25 years. In the beginning I studied constantly, but now I pretty much have my system and I follow it. I write code for about 1/2 the day 7 days a week. I keep up on the new technologies, but I mainly still use Java, C, C++, PHP and JavaScript for everything. I am very lucky in that I can decide what projects I want to work on, so I'm always excited to program. I mainly write programs with a ton of math, or simulations

  • @derekbanas
    @derekbanas  Před 11 lety +1

    Thank you very much :) Ill be making java related tutorials for quite a bit longer. I hope you enjoy them

  • @yaanyfizzle
    @yaanyfizzle Před 9 lety +5

    I just watched 3 tutorials, got absolutely nowhere, and within the 1st 50 seconds of this video you explained it! Derek Banas > All

    • @derekbanas
      @derekbanas  Před 9 lety

      ***** Thank you :) I'm happy I could help.

    • @yaanyfizzle
      @yaanyfizzle Před 9 lety

      Not as happy as I am mate. Thankyou 😌

  • @sandblaster007
    @sandblaster007 Před 5 lety +1

    I know this video is from 2013 but I couldn't wrap my head around recursion at all until I watched this. I'm a freshman in college with a great teacher but she wasn't able to explain it this well. Thanks so much! :D

  • @derekbanas
    @derekbanas  Před 11 lety +1

    Thank you :) I try to make the best videos I can. I'm glad you liked it

  • @sebastianfarias5670
    @sebastianfarias5670 Před 8 lety +1

    wow, every time I struggle with x/y concept there is a video in your channel that helps me understand it 100%... Again, thank you Derek!!!!!

    • @derekbanas
      @derekbanas  Před 8 lety +2

      Thank you for the compliment :) I'm happy I can help

  • @derekbanas
    @derekbanas  Před 11 lety

    I'm glad it helped :) I figured if I provided enough walkthroughs that it would make sense

  • @iNewbieNick
    @iNewbieNick Před 9 lety

    This is my first year in college and I'm majoring in computer science. Our professor just tried to teach us about recursion but didn't do it very well and left the class thinking "WHAT JUST HAPPENED. WHY DID THAT WORK!?!?!", myself included. I've had an issue where I haven't been able to comment on videos for a year and was too lazy to fix it. This video was so helpful, and I'm so grateful, that I got off my lazy ass and figured out how to fix my problem just so I could comment on this video and thank you. Thank you for teaching me about this confusing concept!! You're the best!

    • @derekbanas
      @derekbanas  Před 9 lety

      iNewbieNick Thank you very much for all the nice compliments :) I appreciate you taking the time to tell me that I helped. You're very welcome.

  • @SoeaOu
    @SoeaOu Před 11 lety +1

    Thank You. I was so afraid of recursion and the fact that i couldn't come up myself how to do factorials using recursion, but when I saw the third example I made it myself, so easy :D I think this are the best intermidiate/advanced java tutorials on the internet.

  • @derekbanas
    @derekbanas  Před 11 lety

    I'm happy that I could clear it up. I don't know why so many people struggle with teaching this topic?

  • @justinli19901027
    @justinli19901027 Před 8 lety +78

    Need to concentrate extremely hard but very well explained.

  • @nicolaslondono7188
    @nicolaslondono7188 Před 8 lety

    You are the god father of programming tutorials!

    • @derekbanas
      @derekbanas  Před 8 lety

      +Nicolas Mazorra Thank you for the nice compliment :)

  • @loganphillips1674
    @loganphillips1674 Před 7 lety

    Wow thank you so much. My data structures text book didn't explain at all how this works. I ran an example in the debugger and was extremely confused why it went "back up" once it hit the base case. You cleared it up in the first 2 minutes. Thank you!

    • @derekbanas
      @derekbanas  Před 7 lety

      Thank you :) I'm glad I could help

  • @WhoForgot2Flush
    @WhoForgot2Flush Před 6 lety

    I actually came here because I was trying to make a merge sort algorithm and wanted a better understanding of recursion before starting. Thanks for covering merge sort too very helpful.

  • @YouB3anz
    @YouB3anz Před 10 lety +1

    I think it's worth mentioning that this implementation of merge sort, with in-place index shifting on an array, is O(n^2). Merge sort is usually taught using substructures and is O(nlg(n)).

  • @derekbanas
    @derekbanas  Před 11 lety

    Pick projects that are fun. I only work on fun projects. When I was young and just starting with programming I made games and nothing else because games are fun to make. Games also require you to know many things. Don't try to memorize because that will just bore you. Instead come up with an idea, copy and paste others code and then just fix the errors. Once you get past the basics programming is very fun

  • @danisburner2249
    @danisburner2249 Před 8 lety +40

    Just so you know the dashes confused me really bad as I thought they were minus signs

  • @derekbanas
    @derekbanas  Před 11 lety +1

    Well I'm very happy to help! I'm glad he likes his job at least :)

  • @bigshaqsmathematicalinstit3318

    Just simply amazing. I believe college professors are experts in their fields of study, but some are not cut out to be a educator.

    • @derekbanas
      @derekbanas  Před 4 lety

      Thank you :) I'm happy I could help

  • @derekbanas
    @derekbanas  Před 11 lety +2

    Thank you :) I have a mile long list of algorithms in the works

  • @gadafiali9151
    @gadafiali9151 Před 10 lety +14

    You just earned a comment, a subscription, and a fan.

  • @tpr_iv
    @tpr_iv Před 8 lety +1

    You are awesome dude. Thank you so much for doing these. I'm starting to realize the necessity for self-teaching in the computer science major, and these help loads.

    • @derekbanas
      @derekbanas  Před 8 lety

      +Tom Reilly Thank you :) I'm happy I could help

  • @derekbanas
    @derekbanas  Před 11 lety

    I've used pretty much every language at one point or another.

  • @thecomempire
    @thecomempire Před 10 lety

    Hi Derik- I just wanted to say thank you for all your fantastic videos- they have really assisted me in my studies! No need to sit and read the textbook anymore!

    • @derekbanas
      @derekbanas  Před 10 lety

      Hi, I'm very happy to hear that I could help. You're very welcome :)

  • @derekbanas
    @derekbanas  Před 11 lety +3

    Great! I'm glad I was able to make recursion make sense :)

  • @derekbanas
    @derekbanas  Před 11 lety

    I think I have a pretty intelligent community. Many of them stayed with me through design patterns and refactoring. If they can handle those topics recursion should be a breeze. You are right though that things can go crazy if they try to use the merge sort on a 10,000 item array :)

  • @derekbanas
    @derekbanas  Před 11 lety

    Thank you very much :) It is hard to work through the first time, but after you get it it makes sense. I'm very happy that I've been able to help

  • @123japanuser
    @123japanuser Před 11 lety

    Caro Coach,
    La tendenza sarà in vita fino a quando si ottiene il tutorial grandi.
    Tu sei la ragione per la nostra capacità di migliori.
    Più potenza per voi.
    grazie

  • @redvel5042
    @redvel5042 Před 7 lety

    Actually, for triangular numbers, you can calculate it like this:
    public int getTriNum(int num) {
    return (num + (num * (num - 1) / 2));
    }
    Or a bit more understandably:
    public int getTriNum(int num) {
    for(int i = 1; i

    • @derekbanas
      @derekbanas  Před 7 lety

      Thank you for sharing :) I was just looking for an excuse to use recursion

  • @derekbanas
    @derekbanas  Před 11 lety

    I program with Eclipse Indigo. I record the screen with Camtasia 2. I edit everything with iMovie. My microphone is a simple iPod headphone mic.

  • @mezcop412
    @mezcop412 Před 9 lety +1

    Has anybody else covered Java as well as you have? I remember watching one of your videos at the end of 2013 (for easy code involving HTML / CSS, and so on). I'm becoming obsessed with code and I want everything out of it.

    • @derekbanas
      @derekbanas  Před 9 lety +4

      Mez Cop Thank you for the nice compliment :) I guess I have the most popular Java videos. I'm very proud of that!

  • @lightbikevids1422
    @lightbikevids1422 Před 11 lety

    after watching the first example i understood it so well, my teacher spent a whole class on recursion understood nothing thanks

  • @derekbanas
    @derekbanas  Před 11 lety

    I make custom applications for a small group of people. Mainly tools they use for investing. I also make apps for professors (research stuff). On top of that I run 8 online stores. Yes, it is great to be in a position to turn down business. For 4 years I had to take on every project and it sucked. I'll never put myself in that position again

  • @derekbanas
    @derekbanas  Před 11 lety

    Thank you very much :) Your teacher probably just doesn't like his job. I think the worst thing in the world is being forced to work in a job that one dislikes. I'll do my best to fill in the gaps that your teacher misses

  • @paratek_io
    @paratek_io Před 9 lety

    I learn more from these videos than I do in my Uni courses. Thanks!

  • @veebuv
    @veebuv Před 9 lety +6

    fantastic, got it in one go. Perfectly paced.

  • @Jpgmeg
    @Jpgmeg Před 8 lety

    Very impressed with the quality of these videos! I'm a software engineering student, and these videos are great helpers!

    • @derekbanas
      @derekbanas  Před 8 lety

      +Megan Doherty Thank you :) I'm happy that you like them.

  • @derekbanas
    @derekbanas  Před 11 lety

    Because if you have num + method(num-1) and if num = 1, then 1 + (1-1) = 1.

  • @derekbanas
    @derekbanas  Před 11 lety

    Absolutely you should go! I could have continued, but I was working to pay my way. I got a few scholarships and I refused to take out loans. That is the main reason it was hard for me. I also didn't like the speed and I didn't feel like I was learning everything. College just isn't for everyone, but if I could have afforded to go to a good school for free, or inexpensively I definitely would have gone

  • @paulodeleon1715
    @paulodeleon1715 Před 4 lety

    You earned another subscriber! Thank you so much! In only just 2 mins i did understand it more than my purchased course in Udemy! Thank you very much!

    • @derekbanas
      @derekbanas  Před 4 lety

      Thank you very much :) Happy I could help

  • @derekbanas
    @derekbanas  Před 11 lety

    That will be covered after my next video on the shell and quick sort :)

  • @derekbanas
    @derekbanas  Před 11 lety

    Grazie per le gentili parole. Io continuerò a fare del mio meglio

  • @KETANRAMTEKE
    @KETANRAMTEKE Před 7 lety

    Derek thank you so much. CZcams is awesome because of the content creators likes you.

    • @derekbanas
      @derekbanas  Před 7 lety

      Thank you for the nice compliment :)

  • @user9741
    @user9741 Před 11 lety

    wow, you're first example was all I needed to break the barrier. Thanks!

  • @NusaybaMoft
    @NusaybaMoft Před 10 lety +30

    u go way too fast :/

    • @lordspotato5032
      @lordspotato5032 Před 4 lety +1

      @@_________________404 LOL Liao was talking about her reply to the comment

    • @theelvensong4328
      @theelvensong4328 Před 4 lety +2

      If it goes too fast, you can pause the video and/or go back. Also, watching other videos on related topics like triangular numbers, etc, can help. I do the same.

  • @123japanuser
    @123japanuser Před 11 lety

    Уважаемый тренер,
    Это мульти лингвизм становится серьезным :)
    Спасибо, еще раз, за все, что вы делаете.

  • @derekbanas
    @derekbanas  Před 11 lety

    It is actually pretty easy after a while. Is it worth it? That depends on what you mean by worth I guess :) I very much enjoy helping people and most people are extremely nice.

  • @seemsas
    @seemsas Před 11 lety

    Thanks Derek, for one more illustrative tutorial! Before, I only had a kind of vague idea of recursion but now, I believe to understand it better.
    I'm looking forward to the sorting methods...

  • @anthonyani1631
    @anthonyani1631 Před 5 lety

    I said to myself 'I wish I could double like' . Very nice video! You just got a new follower

  • @jimbotime123
    @jimbotime123 Před 6 lety

    0:00 - 2:04, Explained it better than every other video

  • @coolstuffinlocker
    @coolstuffinlocker Před 7 lety

    I wish I could explain stuff like this guy does.

  • @123japanuser
    @123japanuser Před 11 lety

    Уважаемый тренер,
    Это мульти лингвизм становится серьезным :)))
    Спасибо, еще раз, за все, что вы делаете.

  • @blackfay0
    @blackfay0 Před 3 lety

    Thanks! It has helped me understand the devilish recursion.

  • @aliwally1323
    @aliwally1323 Před 2 lety

    In the box model representation of the first problem (getTriNum) , wouldn't the return of the call getTriNum(1) simply yield the result of 1 rather than the result of the computation of 1 + getTriNum(1 - 1) since the method checks to see if n is equal to 1. If n == 1, there is no recursive call made, the method just returns 1.

  • @crazypigs100
    @crazypigs100 Před 9 lety +1

    Thankyou for posting this! My lecture did not explain this well haha. Hopefully I can one day be able to make videos and help others!

    • @derekbanas
      @derekbanas  Před 9 lety

      crazypigs100 You're very welcome :) I'm glad I could help

  • @MegaVuhung
    @MegaVuhung Před 11 lety

    That's really encourage me to keep on coding (must admit that it's really boring sometimes) Thks anyway!

  • @CC-bm3wb
    @CC-bm3wb Před 6 lety

    You sound like Andy Bernard from the Office. Also, thanks for the video explaining recursion, this makes a lot more sense to me seeing what happens at each step :)

    • @derekbanas
      @derekbanas  Před 6 lety

      I'm happy it helped :) I get compared to Nard Dog all the time

  • @claremacdonald7358
    @claremacdonald7358 Před 8 lety +2

    you sound like andy from the office and i love it

    • @derekbanas
      @derekbanas  Před 8 lety +2

      +Clare MacDonald Thank you :) I hear that all of the time

  • @yourface13able
    @yourface13able Před 5 lety

    I wish I found this guy at the beginning of my semester

  • @MegaGangsta4life
    @MegaGangsta4life Před 10 lety +20

    I have a quiz tommorrow in APCS thx for the help xD

    • @derekbanas
      @derekbanas  Před 10 lety +1

      You're very welcome :) Good luck on your test.

    • @MegaGangsta4life
      @MegaGangsta4life Před 10 lety +1

      I failed the test btw xD

    • @derekbanas
      @derekbanas  Před 10 lety

      MegaGangsta4life I'm sorry to hear that. I always considered failing to be a good thing though because I then focus and move on. Keep at it and you'll do fine. If I can do this stuff so can you. I wish you all the best :)

    • @MegaGangsta4life
      @MegaGangsta4life Před 10 lety +1

      Derek Banas I am an indie game developer, and I program a lot, I took AP Comp Sci because I thought it would help me. I was wrong xD I fail all the test and copy/paste other people`s code just to get a B in the class :P I enjoy programming and Ive made 3 games, I just despise my class. But your tutorials do help a lot

    • @derekbanas
      @derekbanas  Před 10 lety +22

      MegaGangsta4life Keep at it. When the student fails it isn't the fault of the student it is the fault of the teacher. Never let the failings of others define you.
      For some reason in this day in age teachers believe their job is to force students to fail. I think that is lazy. I see no reason to idolize lazy people either :) Only through failure do we appreciate success. The only people that deserve success are those who struggle to find it.

  • @blockbusterlatefees7713

    I'm watching this once every day until it's burnt into my brain.

  • @matthewsagen7243
    @matthewsagen7243 Před 8 lety

    Great video, it moved a little fast for me, once you got into triangular numbers.

    • @derekbanas
      @derekbanas  Před 8 lety

      +Matthew Sagen Thank you :) Sorry about the speed

  • @derekbanas
    @derekbanas  Před 11 lety

    I'll see how soon I can cover that

  • @newmagicfilms
    @newmagicfilms Před 7 lety

    Why we need recursion if we have "while" or "if" ? Can you explain?

    • @derekbanas
      @derekbanas  Před 7 lety +1

      In certain situations recursion makes for dramatically shorter and actually easier to understand code. One common use is with web crawlers. You go to the site and find all the links. You then follow all those links to other completely different pages. This continues forever until you finally come to the end of the line and cycle back to the original page. This would be impossible to do with normal looping, but recursively it is quite straight forward.

  • @derekbanas
    @derekbanas  Před 11 lety

    Thank you :) it is very gratifying to help people

  • @derekbanas
    @derekbanas  Před 11 lety

    I used to be able to speak German and could read and write Chinese and Japanese, but I've since forgotten most of it

  • @derekbanas
    @derekbanas  Před 11 lety +1

    Thank you :) That is very kind.

  • @brunomalmsteen
    @brunomalmsteen Před 9 lety

    Hey Derek, how are you doing? Is is possible to change your code to implement towers of Hanoi and build a trace just like the ones you did for factorial and triangular number? By the way, one of the best videos on this subject available ;)

  • @shilpinator
    @shilpinator Před 11 lety

    Thanks for the help. Its unfortunate that after paying thousands of dollars of tuition to universities, they can only provide us with professors who are incapable of teaching, and we have to come to places like CZcams and hope that there are better instructors out there willing to help us out for 'free'.

  • @azokennedy20
    @azokennedy20 Před 7 lety

    Thanks again Derek. Much clearer now.

  • @derekbanas
    @derekbanas  Před 11 lety

    Yes that would be another candidate for recursion :)

  • @theelvensong4328
    @theelvensong4328 Před 4 lety

    At 2:44 for method 3, shouldn't it simply be "Method 3: number = 1 : return 1"? Since if num == 1, according to the method, it should return a 1. So "1 + getTriNum(1-1)" is unnecessary? Also, "getTriNum(1 - 1)" should never happen because if num == 1, then the else statement is not executed.

  • @derekbanas
    @derekbanas  Před 11 lety

    Mimi najua lugha ya programu nyingi lakini wachache sana zinazozungumzwa. Mimi kamwe kuongea na watu katika ulimwengu halisi hivyo mimi kidogo kutumia kwa ajili yao :)

  • @prasoonpandey1184
    @prasoonpandey1184 Před 7 lety

    Thanks sir. The explanation of the recursive methods was very good and it made it easier for me to understand that. Though, the later portion of the video was too complicated for me. Thank you for the video. I guess I will also use the same way as you to teach my viewers about recursion. Cheers 👏

  • @derekbanas
    @derekbanas  Před 11 lety

    You're very welcome :) Thank you

  • @adityaraj3369
    @adityaraj3369 Před 5 lety

    For every video tutorial I always Listen at 1.5x but you are the only one whose I hear at 0.75x

    • @derekbanas
      @derekbanas  Před 5 lety +1

      I do my best to not waste peoples time :)

    • @adityaraj3369
      @adityaraj3369 Před 5 lety

      Yeah but one thing Your explanation was brilliant

  • @ruimenghu9447
    @ruimenghu9447 Před 11 lety

    these is my dream lecture, Thanks for your patient help.

  • @MegaVuhung
    @MegaVuhung Před 11 lety

    U r really excellent at coding so Can u tell me how much time do u spend to learn or writing code( or sth like that) a day?

  • @roul3688
    @roul3688 Před 6 lety

    A little fast for me but thanks for the video. Glad I have a pause button

  • @mylifeassaifi1708
    @mylifeassaifi1708 Před 8 lety

    Thanks ....your voice is so catchy
    .

  • @NeverMyRealName
    @NeverMyRealName Před 11 lety

    you are awesome man. you're videos helped me re-learn these basic programming concepts! keep it up.

  • @youtubeaccount0x073
    @youtubeaccount0x073 Před 5 lety

    It would help me so much if you did a real life example with out using factorials and triangular numbers

  • @Simon_Alexnder
    @Simon_Alexnder Před 3 lety

    Its time for another "Good Idea / Bad Idea"
    Good Idea: using Recursion with stopping condition;
    Bad Idea: Bad Idea:
    exception stackoverflow;

  • @PuneethBedre
    @PuneethBedre Před 11 lety

    this helped to some extent, but im unable to apply myself in order to trace the recursion algorithm for Towers Of Henoi.
    It'd be nice to have you explain that.

  • @dwc500
    @dwc500 Před 9 lety

    how would you call a recursion function that returns the number of zero digits in the non-negative number that someone entered?

    • @ssj4rit
      @ssj4rit Před 8 lety

      Do something like converting the number parameter to a string. Then use two conditionals. If the first character is not 0, call the function with the parameter as the number string without the first digit. Else, return 1+ function without the first digit in the string. Remember to cast this string back to an int. Your base case should probably take into consideration if number

  • @lamared3492
    @lamared3492 Před 8 lety

    How to write a recursive method that prints a large Z composed of smaller X's with a given "width", n which guaranteed to be odd?
    .
    and another recursive method that prints a session of dropping the cards with C's and S's? For example if you drop it 4 times in a given session, all possible ways to drop it

  • @123japanuser
    @123japanuser Před 11 lety

    Hallo liebe Trainer,
    Das ist eine schwierige Thema zu lernen.
    Dank Ihnen wird es nicht ein Problem in der Zukunft sein.
    Ich bin froh, wieder Gold zu gewinnen :) :)
    Ich bin der aredent Schüler von Ihnen.
    vielen Dank

    • @anjulishukla1189
      @anjulishukla1189 Před 7 lety

      can u tell me how to sum a fibonacci series by recursion only in java... please

  • @raffy3304
    @raffy3304 Před 10 lety

    hello sir Derek. I have this in my applied data structure class and I can't really explain the output of the getFactorial part that you did. I mean, yes, I understand how it works like for n = 3, the 3*2*1 = 6 is the factor of 3. But for the output, I can't cope up how to explain it to myself. This:
    Method 3 // Yes, first output when getFactorial() called
    Method 2 // appear because first if statement is false, 2nd statement is true when "int result = number * getFactorial(number - 1);" called? correct or no?
    Method 1 // appear when "int result = number * getFactorial(number - 1);" called? correct or no?
    Returned 1 // appear when "int result = number * getFactorial(number - 1);" called because the last number is the result of (2-1)?
    Return 2 : 2 * getFactorial(2 - 1)// what now?
    Return 6 : 3 * getFactorial(3 - 1) // and what now for this line? T_T please help me

    • @derekbanas
      @derekbanas  Před 10 lety

      The best thing to do is to print out the changing values as the program runs. That way you'll see everything being built toward the final solution. Be as descriptive as possible with the output. You'll get it

  • @gotenianiki
    @gotenianiki Před 8 lety

    It's excelent explained, but all that non-using code and the comments are confusing me so much. Still a great video.

    • @derekbanas
      @derekbanas  Před 8 lety

      Thank you :) Sorry if I got off track a bit

  • @flowersunny719
    @flowersunny719 Před 4 lety

    Hi Derek, I think the first two "int" arguments in the "printHorzArray" method are not necessary. Could you explain why you put them there? I think you must have some good reasons for that.

  • @amd6328
    @amd6328 Před 6 lety

    i didn't get it
    when i see "else" i do whats under it then continue on .
    i dont go back to "if" because the "if" condition didnt match in the first place.

  • @ankurpaliwal9713
    @ankurpaliwal9713 Před 5 lety

    nice explanation Can you also create a tutorial on using recursion in trees where recusrion is used more than once in a method?

    • @derekbanas
      @derekbanas  Před 5 lety

      Thank you :) I'll see what I can do

  • @EFT202020
    @EFT202020 Před 11 lety

    Your videos are so good! It's just sad that you're on the internet making videos for free while my nutjob for a teacher actually gets paid for being horrible at his job.