Java Programming - Practice Recursion Problems

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

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

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

    Thanks for uploading this video. I was looking for the basic problems on recursion from yesterday to get started on dynamic programming. I could not find a single video which starts from the basic. Most of them are either at a high level, or just algo, or just theory or simply avoid explaining the basics. This video definitely helped me to get started on this topic of recursion.

  • @donrochuios6879
    @donrochuios6879 6 лет назад +17

    this video was so helpful. could you do another set of problems involving strings and arrays?

  • @PhucNguyen-cd2rj
    @PhucNguyen-cd2rj 3 года назад +4

    perfect!!!!! it helps me a lot when i am stucked totally with recursion

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

    Really benefitted from this video
    Especially pausing and doing the problem first then checking my answer
    Thanks a lot great video

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

    Please show the dry run of each question , so that the logic will be cleared .

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

    this video was really helpfull to me, thanks a lot, now I can understand a little bit more about recursion.

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

    For base and power question, the base condition you have mentioned is incorrect. You should use if power==0, return 1 as the base condition. Else 2 to the power 0 which is 1 will throw an error in your code

  • @RahulKumar-tg5zb
    @RahulKumar-tg5zb 7 лет назад +6

    sir plz tell me how can I write a java program using words
    {J, O, K,E,R} to show it's all possible pattern and also count total no. of words formed.

    • @AwaisMirza1
      @AwaisMirza1  7 лет назад +5

      study combinations in maths and use that logic here.

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

    plz explain return 2+catEyes(cats-1) .

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

      each cat has 2 eyes so --> +2
      when calling the function again we need reduce 1 cat as we have counted its eyes by adding 2 --> cats -1

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

    I am learning recursive functions in Haskell and I like the way to connect the same functions topic in both languages. I enjoyed your videos, I have to practice data Structures. Do you have apache Spark video materials, or Scala recursion topic? Kind regards.

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

    Thank you very much the video is very helpful even tho i wished you had some examples with array

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

    Thank you! Your explanations are amazingly clear and the examples really help solidify the theory that we have learnt.

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

    Thank you for taking the time to do this great great video... Fantastic lesson about recursion!

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

    Bro this video was Ok but try to put some advance (how recursion works inside (for loop )) with step by step process

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

    Way too many ads - destroying what could be the best recursion video on youtube.

  • @devada5362
    @devada5362 6 лет назад +1

    For 8: This should be good enough right why bother about all those nested loops?
    public static int countDigit5(int num) {
    if(num < 5) {
    return 0;
    } else {
    if(num%10 == 5) {
    return 1 + countDigit5(num/10);
    } else {
    return countDigit5(num/10);
    }
    }
    }

  • @dimonasdf
    @dimonasdf 6 лет назад +1

    If you'd get a dollar every time you said "All right?"...)
    Nice video anyway, just what I needed.

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

    thank you so much sir. amazing video for cs students

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

    How can we print all the Fibonacci series till n instead of only nth position

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

    Greater explanation thank you sir!!!!!!!!

  • @RahulKumar-tg5zb
    @RahulKumar-tg5zb 7 лет назад +1

    sorry sir for disturbing u again and again.But what can I do videos r really awesome by viewing them I can't stop myself to ask doubts.

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

    "Convert recursive algorithm to non recursive using rules for recursion " can you make video on it

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

    Very helpful. Thanks

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

    Can u explain the control flow of fibonacci series program?

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

      share your email I will help you with the control flow or check this ruclips.net/video/B3U6LExgevE/видео.html&frags=pl%2Cwn

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

    Excellent explanation. Thanks a lot

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

    amazing video very helpful

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

    Thank you so much 💕

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

    Java ka koi apps hai kya sir

  • @MadJDMTurboBoost
    @MadJDMTurboBoost 7 лет назад +4

    @ 35:47 I feel like you overcomplicated that one:
    if(n==0)
    return 0;
    if (n%10 == 5)
    return 1 + count5(n/10);
    else
    return count5(n/10);

    • @MadJDMTurboBoost
      @MadJDMTurboBoost 7 лет назад +1

      Nvm, I see you were just trying to show nested if/else in the base and recursive case. Great video by the way!

    • @Zefanya-Teki
      @Zefanya-Teki 7 лет назад +1

      What happens though if N is a number of 1-9 since you only made a stop for if n==0.
      Or would 9/10 result in a 0 so it would hit the stop?

    • @sichenzhu9651
      @sichenzhu9651 6 лет назад

      There is no problem actually

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

    Very helpful man. Thanks

  • @TRUTHF0RCE
    @TRUTHF0RCE 6 лет назад +1

    Great video! Various exercises in one video, thank you very much.

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

    Thanks ☺️

  • @ullasgokarnkar5858
    @ullasgokarnkar5858 7 лет назад +1

    Awais sir can you please show the back process of fibnocci series using recursion

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

    Best recursion video!!

  • @RahulKumar-tg5zb
    @RahulKumar-tg5zb 7 лет назад

    sir at 5:38 in recursion program to print no. why u have written return in 1st if loop . What is it's use in program.🙏🙏🙏

    • @AwaisMirza1
      @AwaisMirza1  7 лет назад +1

      try to make dry run of this program. return is written to stop method calling when index reaches to zero. otherwise it will keep on calling itself and will never stop. if condition is called base case and base case must return something, null, 0 or any value.

    • @kushagragautam3979
      @kushagragautam3979 6 лет назад

      man exiting condition is always mentioned 1st in the recursion so that function call is not triggered for wrong inputs

  • @VijayGupta-kw4ok
    @VijayGupta-kw4ok 5 лет назад

    Very good sir explaned well

  • @159saur
    @159saur 4 года назад

    Can you please help me to understand a code ?

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

    so helpful!

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

    Hey .please increase your voice level

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

    great video A++ thank you

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

    THANK YOU SIRR!!

  • @Lightyagami-zy4qy
    @Lightyagami-zy4qy 6 лет назад +4

    Why don't u explain it in detail . I mean how the code actually runs !!!

  • @debarati4207
    @debarati4207 5 лет назад +3

    Everything was awesome.... except for the spelling of speakers🤣🤣

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

    good speacher

  • @bassel1074
    @bassel1074 5 лет назад +3

    15:30

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

    explanation is not clear. Specially , return 2+catEyes(cats-1);

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

      Every return 2 sums up. catEyes(cats-1) is a counter like i-- , everytime it decrements - return 2 happens, so for every cat there are 2 eyes. It doesn't make sense to use recursion in this example though, but if you're thinking just make it return 2 * catEyes(cats) that would cause stack overflow due to infinite recursions. You need -1 to reach the base condition of 0 and exit the function.

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

    It would be good if you send source code

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

    you best

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

    I DO NOT GET NONTAIL RECURSION. These examples are so simple...

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

    Cat problem was not recursion

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

      Yeah it is, just it doesn't make sense to solve it with recursion when a simple * 2 will suffice, not even iteration is needed.

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

      @@counterguardian6145 nigga he said that
      But he's simply using as a practice problem
      So we have to try to solve it using recursion

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

    Please decrease the volume of your voice from next video, it is very loud.

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

    45:39

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

    [rikarion] xdddddddd