How to write Recursive Functions

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

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

  • @JacobEriksson
    @JacobEriksson 4 года назад +177

    i got a warm feeling inside when he said "ok friends" at the end 🤗

    • @godfather5777
      @godfather5777 3 года назад +13

      After all we got a fabulous explanation from such a masterpiece.👌👌

  • @_sayandas
    @_sayandas 2 года назад +63

    You're a legend .
    You didn't just teach recursion, you taught us the base of an approach to a program, which many teachers omit.
    I always struggle in finding approaches so thanks a lot.

  • @ClickSonic28
    @ClickSonic28 6 лет назад +127

    Sir your teaching style is so good and so conceptual ..

  • @ShivaniSingh-jt6kl
    @ShivaniSingh-jt6kl 4 года назад +30

    Please never discontinue this channel

  • @Honestly_Marie
    @Honestly_Marie 4 года назад +100

    This is ridiculous! How is it that you are the most concise explaining this?! I am new to coding and I cannot believe that you just made this sooooo simple and understandable. Thank you so much for finally explaining why the heck I am using n - 1 in my recursive functions!!!!!
    Can i just love this video? I mean, "Like" just isn't enough. You are amazing.

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

      which country are you from?

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

      @@ayushkandwal8851 why do you care ? He is from the same planet.

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

      @@hhcdghjjgsdrt235 just curious about the culture thats it

  • @JasonOgasian
    @JasonOgasian 4 года назад +73

    This process was the key to unlocking recursion for me. Thank you so much for making it so clear!

  • @victorial5141
    @victorial5141 Год назад +10

    I've been struggling with recursion for a long time until I found your playlist thank you so much

  • @kwonjihoon2270
    @kwonjihoon2270 3 года назад +7

    I finally found the best programming teacher. I had trouble understanding our lessons at school so I kept on looking for many references online. And voila! I finally found the most concise and comprehensive explanation of the lesson ever Thank you so much Sir. You helped me a lot.

  • @joshuafaburada617
    @joshuafaburada617 4 года назад +13

    Recursion concept can be confusing but this video makes it sounds so easy!! Super duper awesome! Easy to understand even for the first time studying this concept

  • @philosophers_wool
    @philosophers_wool 4 года назад +17

    Hi I really liked your videos specially on Recursion. Also since the name of the playlist includes data-structures , request you to include topics like Stacks, Queues,Trees,Graphs,Heaps and other data-structures too. A playlist on Algorithms will go a long way . The reason I am asking is you are really concise and deliver clearly the lectures .

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

    My go-to when teaching recursion is teaching students how to make a program such that you can list all file names in an array, given a directory. The sub-problem is putting all filenames into an array, and the complex problem is, when the file is a directory, doing the same procedure within. I use this as my go-to to explain recursion, and the results have been very positive. If you are someone who is trying to teach budding programmers, this has been a very solid approach. Just make sure to explain every little detail, including base-case (listing filenames in a directory), and then expanding that function into a recursive version.

  • @gorrepatimadhu6025
    @gorrepatimadhu6025 4 года назад +9

    I think this was one of the best channel to learn c language.
    Thank You sir.☺️
    May God Bless You 💯
    Keep Going ❤️

  • @mohammedahmed-rw9di
    @mohammedahmed-rw9di 3 года назад +10

    Since you are only considering fac(1)=1 and not fac(0)=1 as a base value you will get a segmentation fault error if you try to find factorial of 0 because of infinite recursion.

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

    Your way of teaching in easier method is incredible 🙏🎉🎉🎉

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

    I was looking for recursive for python tutorials ..the basic logic is so well explained, I could work this out as well. Thank you

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

    Genuinely struggle to understanding most coding videos, but this just made sense and was very well explained!

  • @ashishpawar8817
    @ashishpawar8817 3 года назад +28

    Did I just understand recursion...How?is?this?possible?

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

    I was in a trouble in this part. But after watching this, I got a clear idea. Thank you very much

  • @bekirkurt8304
    @bekirkurt8304 6 лет назад +40

    I just want to ask you 'Who is the lecturer of Digital Electronics Course of Neso Academy?, I want to thank him from anywhere I can do. It can be Linkedin, Facebook."
    Best Regards.

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

      Many people want to donate to this channel, i haven't seen such a wonderful explanation of cs and digital electronics before.
      ♥️

  • @gowthamkrishna4745
    @gowthamkrishna4745 Год назад +4

    If you will become lecturer💝 in Any clg then Your salary is priceless💥

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

    Thank to you, now I understand how The recursion works, thank you so much.

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

    it should says
    -------------------------------
    if (n ==0)
    return 1 ;
    --------------------------------
    because 0! = 1
    Thank you so much for the series

  • @TheSabarno
    @TheSabarno Год назад +2

    I used a ternary operator:
    #include
    int factorial(int n)
    {
    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
    }
    int main()
    {
    int num;
    printf("Enter a number.
    ");
    scanf("%d", &num);
    printf("%d
    ", factorial(num));
    return 0;
    }

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

    The voice is so smooth 💞

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

    Thank you so much. Finally I understand how Recursive fuction does work.

  • @abhineveash
    @abhineveash 8 месяцев назад

    Ultimate teaching, after 2years now I had understood now only recursion basic❤❤

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

    This video has become one of the best movements in my life 🥰... Thank you for clear explanation...

  • @Construction-agencyCoUk
    @Construction-agencyCoUk Год назад

    Great video - I finally understand how recursion works. I can also see how stack issues can occur now.

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

    IVE BEEN WORKING ON THIS PROBLEM FOR 2 DAYS AND FINALLY GOT IT AFTER WATCHING UR VIDEO THANK YOUUUUUUUU 😭😭😭😭😭😭😭

  • @SandipanMajumder-b2r
    @SandipanMajumder-b2r 6 месяцев назад

    finally I learned the recusrion concept for you
    thank you so much sir
    you are the best
    god bless you neso academy
    and you dear sir ji

  • @RahulKumar-bd6py
    @RahulKumar-bd6py 3 года назад

    It's just paved me a path that anything in coding is easy by you all persons .
    Be like this 👌 😌

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

    I love you sir I understand so fast with this bless your soul

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

    Really it's the best playlist i found.

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

    The best teaching method in world

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

    Thank u sooo much sir. Lots of respect and love from Nepal...

  • @Khshourav
    @Khshourav 8 месяцев назад

    I have been banging my head for hours but this your lesson made it so easy! Thank you!

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

    I think this is the best exercise to learn Recursive Functions. Well done!

  • @FarhanAli-gd2qv
    @FarhanAli-gd2qv 3 года назад +2

    I am coming from CodeWithHarry youtube channel. Now I regret why I didn't came here first. I am too late now.

  • @jitendrakumarsingh9082
    @jitendrakumarsingh9082 4 года назад +14

    NESO ACADEMY EXPLICITLY EXPLANATIONS ARE UNPRECEDENTED.

  • @digitalnavshad5364
    @digitalnavshad5364 5 месяцев назад

    Thanks for teaching the main thing is that approach to solve the problem that what i am looking for...

  • @arindam-karmakar
    @arindam-karmakar 3 года назад

    Thank you for explaining this so nicely and systematically. I was stuck in a recursive function problem for a while, after watching this video it's now all clear for me. Thanks again.

  • @YosNisiy
    @YosNisiy 9 месяцев назад

    I appriciate about your teaching, clear ,well understood

  • @Albert-Dyck
    @Albert-Dyck Год назад

    Thank you! This was by far the best explanation for me.

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

    omg!!! this video is so helpful....can't thank you enough!!!

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

    AWESOME dude !!! THEE BEST. most clear simple and best way what a great help in ubderstanding this VERY difficult subject matter; RECURSION. thank. YOU. SO. much. !!

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

    woooow such a clean explanation. thanks a lot for your video.

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

    wonderful explanations! really loved it, i always get cleared with your explanations, thankyou a ton!

  • @abhishekdas6429
    @abhishekdas6429 6 лет назад +3

    This would have been a great tutorial(it's good) if you did a dry run and explained how the program would execute(memory allocation in stack space and how the stack finally unwinds and actually calculates the factorial) before running it to find output.
    And the 'if statement' can be modified to check for zero as well.

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

    thankyou very much....i was wasting my time to this topic before this was met....😘😘😘😘😘

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

    It's an amz..aftr watching a lot of vedios..my all doubt is clr here...thnx

  • @sanjanab9287
    @sanjanab9287 9 месяцев назад

    Sir the way you teach make me listen more and your voice is so warm🤍

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

    Great explanation, it finally "clicked" for me!

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

    Thanks a ton, this is honestly one of the best videos on recuersion and helped me grasp it and apply it

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

    Beautiful explanation sir. Many thanks

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

    omg , you are so good on teaching...

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

    Woah outstanding teaching sir 👍

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

    Wonderful teaching 👏

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

    Lots of love to Ur hardwork from my behalf

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

    Loved this video, everything is simply explained.

  • @Anjali-uc1er
    @Anjali-uc1er 4 года назад +1

    I like the way you teach

  • @SHusen-nw6uo
    @SHusen-nw6uo 3 года назад +1

    can you please make video of recursion to print * pattern
    example
    *(1*)
    *** (3*)
    *****(5*)

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

    👏👏This video is awesome. I learned so much in 10 munites. Thanks

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

    “I understood recursion better after your explanation.
    Thank you, sir.
    I have a question.
    What happens if the argument is 0?
    Will the function keep calling itself with
    [0*fact(-1)] and so on?”

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

    Old but Gold!

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

    thank the lord that this channel exists omg

  • @AnkitSingh-xr7lu
    @AnkitSingh-xr7lu 5 лет назад +4

    thanks a lot sir for this great lecture

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

    Sir you deserve some respect and appreciation for the quality content for free
    Thankyou from the bottom of my heart
    Stay blessed
    And keep doing the good work

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

    Best explanation 😍

  • @truth-12345.
    @truth-12345. Год назад

    Damn! This is well put lecture. Amazing!

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

    sir you are amazing!

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

    Kaaaaffiii Pyara explanation

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

    Thank you so much; you saved me in my project!

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

    First time I understand this recursion 😌😌

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

    great explanation, thanks a lot!

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

    I would consider my Base case as
    if(n==1 || n==0) or simply if(n==0)
    because factorial of 0 is 1.
    so we have to keep this in mind if a user enters 0 value,
    so I believe your program will not work properly.
    Happy Coding...

  • @AbhishekKumar-rh3kw
    @AbhishekKumar-rh3kw 6 лет назад +1

    Sir u make recurtion very easy for me.. thanks sir

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

    Soo simple and easy to understand .Thank you sir 😊😊

  • @LearningandEarningwithMK
    @LearningandEarningwithMK 2 месяца назад

    God bless you 👍🏻

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

    great Job Neso

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

    Sir what you just taught is jem for me.. started feeling very confident in programing concepts.
    Thank you sir

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

    Thank you, it was very helpful !!

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

    Thx sir, now I can pass my exam soon 😇🙏🏻

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

    sir your way of teaching is amazing !!! sir please make videos on algorithm and data base management system as well.

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

    I appreciate your content and you are such a Great teacher ❤

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

    you are great sir

  • @drammeh1209
    @drammeh1209 6 лет назад +3

    May God bless you, about have Data structure exams and I really need this material

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

    Very nice video sir!

  • @Howto-ty4ru
    @Howto-ty4ru 2 года назад

    This was awesome, this cleared my head.

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

    thank you sir indian guy of youtube

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

    You are the best!

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

    Sir!!Awesome 🙂easily understandable way,,and ur explanation is like anyone can understand any topic in c

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

    Awesome tutorial

  • @divyangvegda8823
    @divyangvegda8823 2 месяца назад +1

    for negative input, your program will be being infinite loop and factorial of negative does not exist so your code will not work properly so you have to add one other condition for this case

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

    thankssss Neso!!

  • @syeddaniyalalict-0258
    @syeddaniyalalict-0258 Год назад

    You are love man❤️

  • @AKSahu-jh7sk
    @AKSahu-jh7sk 2 года назад +1

    Aap Bahut Ache Hai

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

    Super explanation

  • @GiangPham-zj3pv
    @GiangPham-zj3pv 5 лет назад +3

    Hi I think that you should start the base from 0 because 0 is considered an integer. Right now, if someone inputs 0 it won't work. Starting from 0 would be better I think. But nice video!

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

      This program can be done with simply for loop then what is advantage of recursion

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

      No you can't start from 0 unless you want to do it backwards but that won't work. The recursion won't be forced to split and leave all the numbers to multiply.

  • @prof.wendel6912
    @prof.wendel6912 5 лет назад +1

    Good Explanation, Sir !

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

    Great work!! 👏👏