Recursion in One Shot | Theory + Question Practice + Code | Level 1 - Easy

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • Link to the Notes of Class: drive.google.c...
    Complete C++ Placement Course (Data Structures+Algorithm) : • C++ Full Course | C++...
    Telegram: t.me/apnikaksh...
    Instagram: / dhattarwalaman
    My TH-cam Gear 😉: docs.google.co...

ความคิดเห็น • 856

  • @xdnaitiksaraf1474
    @xdnaitiksaraf1474 3 ปีที่แล้ว +29

    at 30:30
    public static int sum(int n){
    if (n==0) {
    return 0;
    }
    return n+sum(n-1);
    }
    is more convinient

  • @onlythereal333
    @onlythereal333 2 ปีที่แล้ว +44

    Really great tutorial i really stuck in recursion but when you teach with very basic questions i really understood it well with what happens in background coding how recursion works 👍☺️☺️👏🙌

    • @_AAMIR_.AEP.
      @_AAMIR_.AEP. 6 หลายเดือนก่อน +1

      Are you completing your college 😊

  • @mdsarfarazalam8452
    @mdsarfarazalam8452 2 ปีที่แล้ว +93

    Fibonacci series: 47:56
    Power calculation : 1:00:13
    Power calculation in optimized way : 1:12:00 ( log n) its code is : 1:22:40

    • @Shubh.Shorts.
      @Shubh.Shorts. 2 ปีที่แล้ว

      th-cam.com/play/PLu0W_9lII9agS67Uits0UnJyrYiXhDS6q.html

    • @MovieZoneX-02
      @MovieZoneX-02 2 ปีที่แล้ว +5

      Vaiii 46:56

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

    • @kenyelite8574
      @kenyelite8574 ปีที่แล้ว +1

      Thnx buddy

  • @onkarvyavahare3327
    @onkarvyavahare3327 3 ปีที่แล้ว +103

    Stack height concept you have tought was nothing anywhere generally...so thank you for such intuition.

  • @minivishwakarma960
    @minivishwakarma960 2 ปีที่แล้ว +128

    You guys are creating such a valuable content and providing it for free, also motivating us to be better in our fields, hats off to Aman and Shraddha.

    • @pavanmadagani7725
      @pavanmadagani7725 ปีที่แล้ว

      VARANASI SARALA PUUKU MUNDADHI

    • @vloglive
      @vloglive ปีที่แล้ว +2

      Very valuable feedback for them

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

  • @rajivtripathi8403
    @rajivtripathi8403 3 ปีที่แล้ว +19

    Great Great great Job!!!!. Actually Recursion is the toughest logic to implement and the way you teach specially coding in which u need to develop the thought process along with the problems.....you did it so well.....and in very simple way...... I have seen lot of videos on you tube but it is the BEST ONE !!!!great Contribution to community!!! Keep up the good work!!!!

  • @abhinitashrivastava9100
    @abhinitashrivastava9100 2 ปีที่แล้ว +19

    You are amazing! I am a 52 years old but i understand the concepts very well because of you. Thanks!

    • @i.khushii
      @i.khushii ปีที่แล้ว +6

      52 ? And learning java ..? I mean for what ? 😅

    • @annielouise1141
      @annielouise1141 ปีที่แล้ว

      @@i.khushii maybe because the institute asked her to my oops teacher was in same position

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

  • @Veds5861
    @Veds5861 2 ปีที่แล้ว +10

    just use ternary operator n == 1 || n == 0 ? return 1 : n * factorial(n-1) ; 2 lines of code in just one line using ternary
    Thanks mam to make recursion easy to understand

  • @iqbalhossain927
    @iqbalhossain927 3 ปีที่แล้ว +69

    Need this type of practice question in every topic. Hope you continue like this. And thanks for this awesome session😍

  • @faisalkhan1026
    @faisalkhan1026 3 ปีที่แล้ว +82

    This is hands down the most comprehensive lecture for me ! Thank you for making such a high quality, lucid and brilliant explanation video on RECURSION, Your channel is Subscribed right away !

    • @uskapyaar8852
      @uskapyaar8852 2 ปีที่แล้ว +5

      Thank god you said that... I had my hands up this whole time :(

    • @lalalostyou6858
      @lalalostyou6858 2 ปีที่แล้ว +1

      @@uskapyaar8852 😂😂😂😂

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

  • @shifteditz06
    @shifteditz06 5 หลายเดือนก่อน +1

    1:24:04 below code works perfectly fine for both even and odd number, no need of using if else condition(if I'm wrong then run this code without condition)
    public static int optimisedFunc(int n, int power){
    if(power == 1)
    return 1;
    return (n * optimisedFunc(n, power/2) * optimisedFunc(n, power/2));
    }

  • @collegeWale.insane
    @collegeWale.insane 2 ปีที่แล้ว +1

    Bhagwan apka bhala kre... recursion ko detail se smjhane ke liye apka bahut bahut dhanyawad..

  • @haidertest1809
    @haidertest1809 2 ปีที่แล้ว +2

    Another method for factorial using Recursion;
    static void fnc2(int n, int sum){
    if(n == 0){ // BASE CASE
    System.out.println(sum);
    return;
    }
    sum *= n; // ACTION
    fnc2((n-1), sum); // sum will not change for each recursive step
    }

  • @ayushnegi675
    @ayushnegi675 2 ปีที่แล้ว +18

    i can't explain how easily i was able to understand recursion in this video with time complexity,
    thanks a lot to you ma'am

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

  • @abhi.1289
    @abhi.1289 2 ปีที่แล้ว +8

    Best explanation ever..
    Finally i understand recursion... 🥳🥳🥳🥳

  • @prathambharti2462
    @prathambharti2462 3 ปีที่แล้ว +12

    I didn't know Java language but still learning this video because C++ playlist has good content but not for beginainers But it is need more video like this on ds algo

  • @sambitbhakat7021
    @sambitbhakat7021 5 หลายเดือนก่อน +2

    1:21:32 here when alpha is 4 then hight of stack is 3 not equal to alpha

  • @technicalspider2547
    @technicalspider2547 3 ปีที่แล้ว +2

    Slowly aur easily padhaya hai awesome 😀

  • @arshadimam3420
    @arshadimam3420 2 ปีที่แล้ว +4

    Probabily the best teacher in the world for computer science student.

  • @JAGMEETHEBEST
    @JAGMEETHEBEST 3 ปีที่แล้ว +245

    "JEE PREP HO YA COLLEGE KI PADHAI, ONE SHOTS ARE THE BEST!!"😂😂👌

    • @just.indianstuff7537
      @just.indianstuff7537 3 ปีที่แล้ว +6

      How it's taking n as power ?? Like there is math.pow to that we can use power how this happen here??

    • @abdulroufshaik123
      @abdulroufshaik123 2 ปีที่แล้ว +2

      😂😂

    • @pranjalbiswas6585
      @pranjalbiswas6585 2 ปีที่แล้ว

      Wah wah wah wah

    • @sayannitdgp8957
      @sayannitdgp8957 2 ปีที่แล้ว

      😂😂😂😂

    • @mehakarora3977
      @mehakarora3977 2 ปีที่แล้ว +3

      @@just.indianstuff7537 yeah I also didn't understand this .how this is possible??

  • @VijayJain-ls9du
    @VijayJain-ls9du ปีที่แล้ว

    You are Best Teacher Ever..main to aapka all time wala Fan ho gaya...now Recursion is Clear...

  • @sauravjha2933
    @sauravjha2933 3 ปีที่แล้ว +7

    This is the best video on recursion. Thank you so much.

  • @mubeenmavia4
    @mubeenmavia4 2 ปีที่แล้ว +3

    Hello guys! I am from Pakistan. I am learning java from this channel and she is one of the best teachers on TH-cam . The way she explains it is exceptional. I found this channel very valuable

  • @ahmadrasheed2598
    @ahmadrasheed2598 ปีที่แล้ว +15

    I usually don't comment on videos but I have to say the explanation is mind-blowing
    I cannot thank you in words🥰

  • @raunakkumarmishra1449
    @raunakkumarmishra1449 3 ปีที่แล้ว +11

    This is something we can call Recursion
    Thanku Di and thanku Aman bhaiya to bring such people for us❤🔥

  • @ji6442
    @ji6442 3 ปีที่แล้ว +1

    Didi aapka contents PHYSICS WALLAH ke tarah hai...... High quality content of explaining, thank you didi....

  • @moremansi81
    @moremansi81 8 หลายเดือนก่อน +15

    For sum of n natural numbers, i guess correct way with recursion is..
    public class Recursion {
    public static int printSum(int n) {
    if(n==1) {
    return 1;
    }
    return n + printSum(n-1);
    }
    public static void main(String[] args) {
    int n = printSum(5);
    System.out.println(n);
    }
    }

    • @paragshende3390
      @paragshende3390 8 หลายเดือนก่อน

      what happens when we do return 1;
      ?

    • @moremansi81
      @moremansi81 8 หลายเดือนก่อน

      @@paragshende3390 when there is a function call (new stack frame) with n==1 then 1 is returned back to stack frame from where this call is made

    • @kishordhobale6317
      @kishordhobale6317 7 หลายเดือนก่อน +1

      this is simple way to calculate sum of n number which you explained.good job

    • @uditnagar7905
      @uditnagar7905 5 หลายเดือนก่อน

      Yes you are right. I also did the same

  • @nocturnal_wanderer
    @nocturnal_wanderer 3 ปีที่แล้ว +2

    In the last problem, in the even part, it should be if(n==1) return x; Otherwise coz of the n==0 we get x^0=1 then x^1 will be equal to 1 and so on...

  • @lalitvats9803
    @lalitvats9803 2 ปีที่แล้ว +4

    I am in Coding Ninja Coding boot camp, but they teach like, only doing there job. For understand the fundamentals and concepts, I always prefer Apn college. Very Easy explanation ❤❤❤

  • @siddhantpatel01
    @siddhantpatel01 3 ปีที่แล้ว +9

    Thank you so much all team members of aman bhiya aman bhiya you are doing really really really great work . when i wached apna college then i feel I'm graduating form Apna college institute of engineering and technology

  • @gulshanbindua7471
    @gulshanbindua7471 3 ปีที่แล้ว +7

    Without 3 variable, you can also use

  • @venkateshjacke7238
    @venkateshjacke7238 ปีที่แล้ว +2

    Hi shardha
    in function calpower we dont require to chk the condition for x since we are not editing it also the height of the stck can be reduced by adding a basecase of if(n==1) return x; so the height will be n-2 here pls correct if anything wrong Thankyou

  • @kakshabaravijeeneet
    @kakshabaravijeeneet 3 ปีที่แล้ว +3

    Bestest Video On Recursion ❤

  • @Shivam.Tiwari.
    @Shivam.Tiwari. 24 วันที่ผ่านมา

    1:24:00
    mam is code me ek issue hai, n (power of x) ki base condition set nhi kari, jo condition set h wo h " n==0" which is never going to possible.
    solve is liye hua becuase you had an Odd number as Input.
    just add one line
    if(n==1){
    return x;
    }

  • @akashmondal3952
    @akashmondal3952 10 หลายเดือนก่อน

    31:06 instead of sum+=i we can do (i==n+1) and then print sum then return.

  • @Gamer_0057
    @Gamer_0057 2 ปีที่แล้ว

    53:57 We can also do this if we dont want to do anything in the main class -
    public class fibonacci {
    public static void main(String[] args) {
    int z = 5;
    int a = 0;
    int b = 1;
    int c = 0;
    calcFibonacci(a, b, c, z);
    }
    public static void calcFibonacci(int a,int b,int c,int z){
    if(z==0){
    return;
    }
    c = a+b;
    System.out.print(a);
    System.out.print(b);
    System.out.print(c);
    a = b+c;
    b = c+a;
    calcFibonacci(a, b, c, --z);
    }
    }

    • @SIR.abinash
      @SIR.abinash 2 ปีที่แล้ว

      Han but jyada lagega though yhan ye itna jyada nhai hai but take a big no. For consideration.

  • @sandeshvora
    @sandeshvora 3 ปีที่แล้ว +2

    In last and second last problem we can change first base case to... If(n==1) return x;... So that no of levels and value of n remains same...

  • @nerdyboy2443
    @nerdyboy2443 ปีที่แล้ว +1

    31:30 why so complicated, try this one...
    import java.util.Scanner;
    public class Main {
    public static Scanner sc;
    public static void printSum(int n, int sum){
    if(n== 0){
    System.out.println(sum);
    return;
    }
    sum += n;
    printSum(n-1,sum);
    }
    public static void main(String[] args) {
    sc = new Scanner(System.in);
    int n = sc.nextInt();
    printSum(n, 0);
    }
    }
    43:30 again why so complicated....
    import java.util.Scanner;
    public class Main {
    public static Scanner sc;
    public static void printFact(int n, int mul){
    if(n== 0){
    System.out.println(mul);
    return;
    }
    mul *= n;
    printFact(n-1,mul);
    }
    public static void main(String[] args) {
    sc = new Scanner(System.in);
    int n = sc.nextInt();
    printFact(n, 1);
    }
    }

  • @adityaagarwal2324
    @adityaagarwal2324 3 ปีที่แล้ว +143

    Didi, backtracking ke upar bhi dedicated playlist banaiye please

    • @lokendrasingh9780
      @lokendrasingh9780 3 ปีที่แล้ว +1

      we want marathon on backtracking 🔥🔥🥰🥰

    • @adityadixit7973
      @adityadixit7973 3 ปีที่แล้ว +1

      Yes

    • @adityadixit7973
      @adityadixit7973 3 ปีที่แล้ว +1

      Need a complete course on java like the c++ complete series

    • @prshark84
      @prshark84 3 ปีที่แล้ว +1

      Which college

    • @adityaagarwal2324
      @adityaagarwal2324 3 ปีที่แล้ว

      @@prshark84 apna college

  • @be_rajeevkumar
    @be_rajeevkumar 2 ปีที่แล้ว

    Kitna aacha samjaya h apne didi.
    Thankyou so much to making a good start in recursion.

  • @prathmeshsingh9699
    @prathmeshsingh9699 2 ปีที่แล้ว +1

    Madam your way of explaining is awesome

  • @dhruvjoshi4192
    @dhruvjoshi4192 3 ปีที่แล้ว +3

    Thank youu dii..bas aise hi continue rkhna ab please 🥺❤️

  • @vishnureddy5060
    @vishnureddy5060 3 ปีที่แล้ว +6

    Hello sister we need more videos like this java.... Thank you for your previous videos

  • @gaurigupta5129
    @gaurigupta5129 3 ปีที่แล้ว +4

    Great explanation! Best lecture of recursion on you tube.

  • @VaibhavKKM
    @VaibhavKKM 2 ปีที่แล้ว +1

    Easiest code for Sum of n Natural No:-
    class jjsr{
    public static int sum(int n){

    if(n==0){
    return 0;
    }
    return n + sum(n-1);
    }

    public static void main(String[] args) {
    int n=10;
    System.out.println(sum(n));

    }

    }

  • @ArjunSharma-gp6hy
    @ArjunSharma-gp6hy 3 ปีที่แล้ว +34

    Yes we need a dedicated playlist on backtracking topic 👍

    • @ArjunSharma-gp6hy
      @ArjunSharma-gp6hy 3 ปีที่แล้ว

      @masskie star this video is not available, but why?🙄

  • @khushigupta2206
    @khushigupta2206 ปีที่แล้ว +2

    You have explained one of the complex topic in a very smooth way. Very Thankful🥰

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

  • @chinmayajena9318
    @chinmayajena9318 2 ปีที่แล้ว +2

    Last question is so dengerious..Didi🙂dimag nehni chalapaya us type ke question par...but rest of the question are easy to catch...thanks for sharing this type of difficulty label class...❤❤❤

  • @psychoArvind
    @psychoArvind ปีที่แล้ว

    The best part is you know shraddha didi hindi + English dono me hi explain kar deti hai toh smjh me bohot ache se aa jata hai 😊

  • @armankhan-pl6sw
    @armankhan-pl6sw ปีที่แล้ว

    public static int SumOfN(int n) {
    if (n == 0)
    return 0;
    return n += SumOfN(n - 1);
    }

  • @abhijitjha4409
    @abhijitjha4409 ปีที่แล้ว

    public static int sum(int n){
    if(n==0)
    return 0;
    else
    return n+sum(n-1);
    }
    Better Time Complexity and Space Complexity

  • @Lucien88
    @Lucien88 ปีที่แล้ว

    factorial ke liye i did this.
    public static void Factorial( int n, int fac){

    if(n==0){
    System.out.println(fac);
    return;
    }
    fac = fac*n;
    Factorial(n-1, fac);
    }

  • @parthanuj8611
    @parthanuj8611 ปีที่แล้ว

    i can gaurantee that this the best video on recursion

  • @pranavchaudhari3268
    @pranavchaudhari3268 5 หลายเดือนก่อน

    Another way to print factorial
    public static void printFactorial(int n,int f){
    if(n == 1){
    System.out.println(f);
    return ;
    }
    f *= n;
    printFactorial(n-1,f);
    }

    public static void main(String[] args) {

    printFactorial(5,1);
    }

  • @technicaladda7841
    @technicaladda7841 2 ปีที่แล้ว +1

    Lots of love to your lactures seriously now I am able to learn recursion otherwise I was thinking recursion is not my type 😂

  • @YawarAbass
    @YawarAbass 3 ปีที่แล้ว +4

    Waiting for this video from lot of time. Thanks 🤗

  • @akshat9117
    @akshat9117 หลายเดือนก่อน

    We can also print the sum of numbers like this =>
    void PrintNNaturalNumbers(int num , int sum){
    if(num==0){
    Console.WriteLine(sum);
    return;
    }
    sum+=num ;
    PrintNNaturalNumbers(num-1,sum);
    }

  • @abignyareddymadireddy2434
    @abignyareddymadireddy2434 3 ปีที่แล้ว

    Sum of n numbers another solution:
    import java.util.*;
    public class sample {
    public static int sum(int n) {
    if (n == 0) {
    return 0;
    }
    return n + sum(n - 1);
    }
    public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int res = sum(n);
    System.out.println(res);
    }
    }

  • @Souravx-x07
    @Souravx-x07 3 หลายเดือนก่อน

    At 40:10
    public class Main{
    public static void printfact(int x , int fact) {
    if(x == 0 || x== 1){
    System.out.println(fact);
    return ;
    }
    fact *= x ;
    printfact(x-1 , fact);
    }
    public static void main(String[] args){
    int x = 5 ;
    int fact = 1 ;
    printfact(x,fact);
    }
    }

    • @EXEOP-lo5yl
      @EXEOP-lo5yl หลายเดือนก่อน

      bht complex krra hai faltu me tu bhay issko

  • @Toduu77Toduu77
    @Toduu77Toduu77 3 หลายเดือนก่อน +1

    Thank you, mam very good explanation.

  • @manjarisen7603
    @manjarisen7603 3 ปีที่แล้ว +2

    Execellent vedio! Best 👍💯 of I've ever seen

  • @Vivekkkk-27
    @Vivekkkk-27 ปีที่แล้ว

    public static int printSum(int n , int m){
    if(n ==m){
    return m;
    }
    else{
    return n+ printSum(n-1 , m);
    }
    }
    public static void main(String args [ ] ){
    int n =5; // 3+4+5 = 12
    int m = 3; // print sum from 3 to 5
    int ans = printSum(n , m);
    syso(ans);
    }
    To print sum of number between m to n by recursion method

  • @soniamalik7136
    @soniamalik7136 ปีที่แล้ว

    Didi aaap bhot badiya padhti ho ❤️...
    Concept arram se clear ho jate hai

  • @santoshyadav11111
    @santoshyadav11111 2 ปีที่แล้ว +1

    Best lecturer in the world for me didi🙏♥️

  • @nishantyadav7461
    @nishantyadav7461 3 ปีที่แล้ว

    best video i ever show of recursion

  • @salahiansofficial424
    @salahiansofficial424 3 ปีที่แล้ว +18

    Please make a series of java, we would be really thankful to you cause the way you are explaining things it's just too easy to get you.

    • @mrbob2148
      @mrbob2148 3 ปีที่แล้ว +1

      ++

    • @Shubh.Shorts.
      @Shubh.Shorts. 2 ปีที่แล้ว

      @@mrbob2148th-cam.com/play/PLu0W_9lII9agS67Uits0UnJyrYiXhDS6q.html

  • @santoshsinghpawar9015
    @santoshsinghpawar9015 2 ปีที่แล้ว

    You are one of the best online teacher. Thank you for making such videos.

  • @Pankaj_Mandal7028
    @Pankaj_Mandal7028 9 หลายเดือนก่อน

    In last question Calculate power:
    calcPower(x,n/2) was called twice, this can be optimised by storing the value in a variable.
    Overall very good video.
    Thankyou!

  • @arnavsharma440
    @arnavsharma440 16 วันที่ผ่านมา

    44:00
    public class recursion4FACTORIAL {
    public static int intnumbers(int n){

    if(n==1){

    return 1;
    }
    return n*intnumbers(n-1);
    }
    public static void main (String args[]){
    //int n = 5;
    System.out.print("input");
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.print(intnumbers(n));
    }
    } easier way try it

  • @vikalp.pandey
    @vikalp.pandey ปีที่แล้ว +1

    public class Recursion {
    public static void printfact(int i, int n , int fact){
    if(i==n){
    fact *=i;
    System.out.println(fact);
    return ;
    }
    fact *= i;
    printfact(i+1,n,fact);
    }
    public static void main(String args[]){
    printfact(1,6,1);
    }
    }

  • @Suman-KD007
    @Suman-KD007 ปีที่แล้ว

    public static void Print(int i, int n, int sum){
    if(i==n || n==0)
    {
    sum=sum*i;
    System.out.println(sum);
    return;
    }
    sum=sum*i;
    Print(i+1,n,sum);
    //System.out.println(i);
    }
    Can this be also a substitute to the factorial program at 40:55?

  • @manalitawar5327
    @manalitawar5327 ปีที่แล้ว +1

    Hi Shraddha, I think the time complexity for the last question to calculate x^n is O(n) instead of O(logn) beacuse we are calling calcPower twice in the return statement. If we store the value of calcPower after calling it once in temporary variable and multiple with itself and return this will help in the time complexity reduce to O(logn).

  • @noornymph3503
    @noornymph3503 3 ปีที่แล้ว

    You guys are doing brilliant work.Love from Pakistan💖💖💖💖💖

  • @kishordhobale6317
    @kishordhobale6317 7 หลายเดือนก่อน

    for find factorial we can use return n * fact(n-1)
    base condition if(n == 0) return 1 ;
    this is simple way to print factorial

  • @sourabsen9679
    @sourabsen9679 2 ปีที่แล้ว +2

    Thank you so much for explaining recursion in such simple yet detailed manner.

  • @mrlalit0552
    @mrlalit0552 3 ปีที่แล้ว +4

    Thank you so much, mam it's too good 👍 learning 📕 platform

  • @devansh_4u
    @devansh_4u 2 ปีที่แล้ว +1

    In x^n question can we do it this way:
    public class recursionOne {
    public static void pow(int pro, int x, int n) {
    if (n==0) {
    System.out.println(pro);
    return;
    }
    pro*=x;
    pow(pro, x, n-1);
    }
    public static void main(String[] args) {
    pow(1, 1, 0);
    }
    }

  • @ranatalha8327
    @ranatalha8327 ปีที่แล้ว

    thanks a lot i am from germany doing my software engineering degree you really help me lot thank you very much

  • @adnanrafique4785
    @adnanrafique4785 2 ปีที่แล้ว

    I have learned first time , I have to build a great understanding of recursion thank u very much and also keep it up,

  • @uskapyaar8852
    @uskapyaar8852 2 ปีที่แล้ว +2

    I think if we take base condition in question of x^n (stack height = n) as if n = 1 return x; then we can achieve exact stack height of (n)

  • @rajeshkumarchaudhary8525
    @rajeshkumarchaudhary8525 2 ปีที่แล้ว

    i am trying to understand recursion from many resources but finally understand now.thanks

  • @mungraprince5798
    @mungraprince5798 4 หลายเดือนก่อน +1

    Thank you easy method to understand mam

  • @trending9120
    @trending9120 3 ปีที่แล้ว +7

    Didi please make complete java series
    Your teaching style is amazing

    • @rickiodious
      @rickiodious 3 ปีที่แล้ว +1

      This is a part of the complete java series...

    • @pavanmadagani7725
      @pavanmadagani7725 ปีที่แล้ว

      VARANASI SARALA PUUKU MUNDADHI

  • @shivamtripathi5764
    @shivamtripathi5764 3 ปีที่แล้ว +1

    काबिले तारीफ दीदी 🙏🙏🙏🙏🙏
    You are great 😎

  • @Lalit_Namdev
    @Lalit_Namdev ปีที่แล้ว

    amazing way of learning in youtube 😊

  • @ABDULREHMANJAVED-h4z
    @ABDULREHMANJAVED-h4z ปีที่แล้ว

    Very Helpful
    Thank you so much for explaining recursion in such a simple yet detailed manner.

  • @nilavabishnu
    @nilavabishnu 2 ปีที่แล้ว +3

    for the question : print x^n (!st one)...how is the power happing in calcpower(x,n-1)....is it being used as math.pow?

  • @deepakgaroda975
    @deepakgaroda975 3 ปีที่แล้ว

    Now my Recursion Concept clear your teaching way Awesome mam ....

  • @AMALRAJTECHWORLD-uo7zx
    @AMALRAJTECHWORLD-uo7zx 3 หลายเดือนก่อน +1

    ThankYou Shradha deedi.😊

  • @abhijitmondal9203
    @abhijitmondal9203 2 ปีที่แล้ว +2

    Awesome teaching style. Great illustrations. Keep it up. 👍🤘🙂

    • @ZainDiscoveries
      @ZainDiscoveries ปีที่แล้ว

      th-cam.com/video/qWx5ZAFkSfk/w-d-xo.html

  • @huzefabattiwala3106
    @huzefabattiwala3106 8 หลายเดือนก่อน

    Fibonacci
    public class main {
    public static int fib(int n){
    if (n

  • @Vivekkkk-27
    @Vivekkkk-27 ปีที่แล้ว +3

    public static int printSum(int n){
    if(n ==0){
    return 0;
    }
    else{
    return n+ printSum(n-1);
    }
    public static void main(String args [ ] ){
    int n =5;
    int ans = printSum(n);
    syso(ans);
    }
    An easy and better code for printing sum of n numbers using recursion

  • @Youtube-Falcon
    @Youtube-Falcon 2 ปีที่แล้ว +1

    In the last question it was very tough to understand and i couldn't find anyone who can dry run this and explains 1. how calcpower (x , n/2) is able to return a value while what to do in function isn't defined 2. What if n==1 , bcoz it isn't the base condition . So if anybody who is stucked in there reply your question here . And many many thanks to Microsoft wali didi for exposing us to such types which aren't available in such a easy language

    • @hemamadala1868
      @hemamadala1868 10 หลายเดือนก่อน

      same doubt, if u got to know the answer please explain to me

  • @monika_12934
    @monika_12934 8 หลายเดือนก่อน

    your teaching is FAB . I will join college this year and i am looking forward to watch your videos through my whole journey. Thank you for this amazing playlist didi..

  • @saurabhkumarsingh9550
    @saurabhkumarsingh9550 3 ปีที่แล้ว +2

    👌🏻👌🏻 mja aa gya video dekh ke

  • @sukuxsharma
    @sukuxsharma 3 หลายเดือนก่อน

    27:40 points
    39:38 parameters work base

  • @monikanagar2792
    @monikanagar2792 2 ปีที่แล้ว

    You are given a sequence of numbers of size N. You have to find if there is a way to insert + or - operator in between the numbers so that the result equals K.
    How to solve this problem using recursion?

  • @sohamtanpathak9067
    @sohamtanpathak9067 ปีที่แล้ว

    Perfectly explained each question, last question was mind blowing!

  • @arunabhachatterjee9979
    @arunabhachatterjee9979 ปีที่แล้ว

    calculate power another method easy :
    class test{
    public static void main(String[] args) {
    power(2, 3, 1);
    }
    public static void power(int a, int n, int c){
    if(n

  • @nikamol8713
    @nikamol8713 2 ปีที่แล้ว +1

    You are greatest teacher..❣️