Ep5 - Using recursion, check whether a string is a palindrome or not | DSA series

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

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

  • @iamdhirajshastri
    @iamdhirajshastri 2 года назад +51

    Day 5 Done ✅
    Congratulations Guys, if you are consistent from last 5 days because 5th & 10th day are the most difficult day of consistency ⚡ By the time you'll reach 21st day you will be champ. 👑 Hope this motivates you all❤😊

  • @AbhishekVerma-ev5tv
    @AbhishekVerma-ev5tv 2 года назад +6

    Points -
    1. Basic solution is to use two pointers from middle, from ends OR reverse the string.
    2. In recursion, we will only take the loop and convert it to recursion. i.e. we still will have left and right end chars in same call (and not have some mechanism to store and compare in appropriate number of call). L and R represent the substring which needs to be checked for substring. [hence the 0 and n-1 initial values as we need to check whole string at first.]
    3. Since, we return boolean as final answer, we will return true/false in base and invalid cases (here base case is a valid case). For Induction step(where we make next call), we don't need to take and/or since this is a Unary recursion tree.
    *Note - Recursive solution is "inferior" to iterative solution in terms of space complexity (expected due to stack)

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

    I have solving palindrome problems using loop, today i learnt new thing that we can solve it using recursions as well. thanks bro.

  • @productivewind
    @productivewind 2 года назад +7

    Sorry for the late Fraz bhaiya. But EP 5 is DONE. Thank you for your consistency and I always appreciate you for your 0 to pro
    type content.

  • @naveenh183
    @naveenh183 2 года назад +8

    One small suggestion Fraz bhai ..!! The logic explanation is superb.! In one go I am able to understand. It would be good if you can explain the code also so that it will be easy for us to understand and this helps us to explain to interviewer also in much smoother way. Because these days interviewers are preferring the explanation of code which we write. I know it might look silly suggestion but it helps us a lot.

  • @bhupendrasingh7788
    @bhupendrasingh7788 2 года назад +2

    You are hard working for us until finish this series I will never give up
    I will watch your daily lectures and be consistent

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

    video best like previous.n/2 is write because there is 0 to 4 and all i assumen .baki no doubts.ur videos is like 6 baj gaya aaaj ka video chalo kar lete hai .im student .but ik working professional ke liye ye daily challange time ki waje se kaffi accha lag raha hoga superb bhaiya.consistent op

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

    The way of explaination is mindblowing. Keep it up.

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

    With this course, you are giving us more than DSA lessons
    You are teaching us discipline perseverance and to show up every day no matter what(which will stay for life)
    Thank you so much bhaiya♥

  • @piyushsrivastava5581
    @piyushsrivastava5581 2 года назад +2

    A small request Fraz to cover more in one video and also plz dry run the code for a few cases. Gives loads of insight like in last video you did ♥️♥️!!! #missionamazon

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

    Eagerly waiting for the video daily same as i used to wait for a show on TV in my childhood😄😁

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

    the simplest explanation ever.. loved it.

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

    take a bow for ur consistency

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

    Concept cleared !!!amazing

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

    bhai bht acha kaam kra h ....lots of love :)

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

    Yeah, now catch your speed.. Feeling confident. 👍

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

    Bhaiya lectures are really good. Like as a beginner I am understanding this recursion series very well but pls suggest how to gain confidence over topic of time and space complexity

  • @aakashbhargava1
    @aakashbhargava1 2 года назад +2

    I think we should increase pace of this course its just a suggestion and you know better than me fraz bhaiya
    thank you

  • @Abhishek-fo3fc
    @Abhishek-fo3fc 2 года назад +1

    Done understood day 5✅

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

    superb video
    having no doubt😊

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

    you are one of the best teacher keep uploading videos brother...

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

    Present ! I'm owner to you for this lovely video ! Please make more video on recursion ! It Will help me more to strong my DSA Knowledge !🙌✔

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

    Ep5 also done successfully ✅
    Abhi tk sbkuchh mst samajh aa ra 😌

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

    Day 5 completed
    Please give more questions for practice and homework

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

    Thanks for the video
    Day 5
    Consistency✌✌✌

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

    Very well explained ! ..Thanks for your support

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

    Nice explanation bhaiya.
    Thank you for this video

  • @Sandeep-zd6dq
    @Sandeep-zd6dq 2 года назад

    Bhaiya we want more questions🔥🔥 great explaination

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

    Palindrome problem is now bit easier 🔥🔥

  • @avadhutlohar5181
    @avadhutlohar5181 2 года назад +2

    #DAY_5
    Consistency OP🔥🔥🔥🔥

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

    Fraz bhai 🔥🔥

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

    Thank you for so good digestible content. One request can you come up with a small scenario of real time project where we are using these DSA concepts. As of filling a form where next questions are based on previous one and have a concept of DSA. Thank you in advance...

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

    Thnq bhaiya for ur every effort

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

    watched till end 👍

  • @anirudrabrahma_0971
    @anirudrabrahma_0971 2 года назад +13

    I always do the problem using iterative solution 😂 learnt the recursion approach from this video. Thank you so much for hard work and regularity. Keep on doing that, enjoying so much big bro ❤️❤️

    • @LearnYardYT
      @LearnYardYT  2 года назад +6

      Woow I see your comment daily ❤️.
      Thanks for writing ☺️

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

      @@LearnYardYT Yeah i love these videos so much because I badly waiting for such bootcamp which covers everything and not wasting time much. I know how you work hard for us. So it is a greatfulness towards you. ❤️

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

      @@LearnYardYT l==r right for base condition why L>=r

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

      @@LearnYardYT can you pls tell me why L>=R in the base condition L== R what is the difference in that

    • @ritikchauhan8902
      @ritikchauhan8902 2 года назад +2

      @@ramakrishna4092 it helps when size of string is even , do dry run of {1 2 1 1 2 1},you will understand

  • @Shorts-sc3is
    @Shorts-sc3is 2 года назад +3

    Provide assignments for practice daily. This will help everyone.

  • @praash.
    @praash. 2 года назад

    Very useful video because since 5 days I solve this question but this solution is best .
    Bhaiya can you make a video for iteratively Approach please.

  • @nihalbarudwale
    @nihalbarudwale 2 года назад +13

    Can you share 1 problem as a homework like after discussing 1 problem in video, you can give us that topic related problem for solving.
    I understood the recursion concept well thanks to you.

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

    Waiting for next topics!

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

    Thankyou bhaiya for this session

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

    nice explanation keep up the good work.

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

    Great video !

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

    very good series

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

    Please take more examples or questions on logarithmic time complexity. N also tell please bhaiyaa how to find or think when we can say this is taking log time/space

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

    Nicely explained!

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

    this is very expensive seriese
    🥰🥰🥰

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

    great lecture😊

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

    waiting for more such content!!!

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

    Sorry for the late bhaiya 🥲
    But covering all your videos
    Keep making , its very effective ❤️

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

    Complete Day 5 ❤️

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

    wonderful video

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

    bhaiya, can you please share the syllabys plan for your course? means expected dates for completion of topics.

  • @SRV.77
    @SRV.77 2 года назад

    😊😊😊Thank u bhaiya

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

    Thank you soo much bhiya for your efforts 🙌 present

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

    started from watching yesterday....today is my day 2 and had completed 5 episodes.......love to watch this serious its motivates me thankyou @leadcodingbyfraz

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

    Done✅

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

    So ideally , out depends on inner output is varied in this recurssion

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

    so great brother

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

    Lecture 5 - ☑
    #Dsabyfaraz
    #recursion❤

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

    day 5 done

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

    Video is good with the analysis.

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

    Good Video

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

    oosm explanation

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

    Bro it's is good example but I think if we do by two pointer approach then space complexity will be constant as compared to recursive one which O(n) space but good for recursive understanding ❤❤❤❤❤❤

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

    Very much enjoying 😊

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

    Very clear

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

    I like yours video's 🥰

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

    Can you also provide practice problems and also what will be the total duration and topics covedered for the entire DSA series?

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

    very helpful

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

    Episode 5 done ✅

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

    Class 5 done☑

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

    Hi Fraz,
    For Palindrome question, java code is not working could you please look on that once and reply me if possible for you.

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

    Sir, please cover data structures like vectors, maps stacks, queues etc in details.
    Please sir it will be very helpful for people like me who are absolute beginner .

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

      Please all these data structures just after this recursion sessions !!

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

    Day 5
    Done✅✅

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

    done bhaiya..completed

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

    Ep: 5 Done !

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

    Lec 5 Done

  • @mma-dost
    @mma-dost 10 месяцев назад

    Thanks bhaiya

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

    How this function in 2nd iteration returning true ?It is not either the base case or the that false case(s[l]!=s[e])..how is it returning true?

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

    Sir will the space complexity will also be O(n/2) for the recursive solution?

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

    Bhaiya I am submitting my codes in python language I am getting TLE errors in code studio platform the code was similar to the code which you posted in GitHub what I need to do please do reply

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

    Day 5 Done🙂

  • @Sahilsharma-sk5vr
    @Sahilsharma-sk5vr 2 года назад

    thank you sir

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

    It is very good

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

    Edit the video to zoom on the code you are writing , it will be more comfortable and good for viewing

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

    Thanks!

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

    can anyone explain the l >=r, what is l>r?

  • @DeepakTiwari-bb9tm
    @DeepakTiwari-bb9tm 2 года назад

    Now revision 💪

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

    Hai sir, I didn't see the code in java, Could you please upload from Episode: 4

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

    completed👍

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

    Thanks

  • @terminator2.03
    @terminator2.03 2 года назад

    Bhaiya , I have doubt for the recursion tree, I mean we are "returning" the function inside the function right so the function will not be there in the stack call to return back to . I think at the end when l = r then we return true and that marks the end of the recursion tree.
    pls clarify my doubt.

  • @bhavyasharma.111
    @bhavyasharma.111 2 года назад

    bhaia plz tell me is the best case complexity is big O(1)

  • @kapiltanwer552
    @kapiltanwer552 10 месяцев назад

    nice video

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

    Can you provide detailed schedule for dsa series

  • @apptrendz
    @apptrendz 2 года назад +14

    JAVA CODE
    public class Solution {
    public static void main(String []args){
    Solution ans= new Solution();
    String obj="level";
    ans.isPalindrome(obj);
    }
    public static Boolean Palindrome(int i, int j,String s) {
    if(i>=j) return true;
    if(s.charAt(i)!=s.charAt(j)) return false;
    return Palindrome(i+1,j-1,s);
    }
    public static Boolean isPalindrome(String s) {
    System.out.println(Palindrome(0,s.length()-1,s));
    return Palindrome(0,s.length()-1,s);
    }
    }

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

      iss it necessary tom take the helper functions

  • @516_harshjain2
    @516_harshjain2 2 года назад

    bhaiya can you increase the number of videos uploading to the channel because a video of a question hardly does anything, but though enjoying the course

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

    Sir in this question what is best iteration or recursion can you tell us in every video that with the help of iteration or recursion we can solve it fastly

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

    solved this problem using recursion for the first time...

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

    Forgot to comment, now done😁