Recursion in One Shot | 9 Best Problems

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

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

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

    The title of the video is so aptly named and the instructor is very clear on the fundamentals and doesn't shy away from enumerating all the possibilities to help the student visualize the problem. Hats off to the effort you have put in making such an obscure topic so tangible. Looking forward to more videos on this series.

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

      Can you provide me with the 1st part of this video plz.

    • @minaalkhajuria8681
      @minaalkhajuria8681 วันที่ผ่านมา

      Placement kaisa rha fir???

    • @jayprakashkumar4492
      @jayprakashkumar4492 16 ชั่วโมงที่ผ่านมา

      😂😂😂​@@minaalkhajuria8681

  • @prabhu5220
    @prabhu5220 11 หลายเดือนก่อน +18

    Can't thank you enough for this video , this video made me get less anxious about recursion . thank you so much!!

  • @adityabhatt4177
    @adityabhatt4177 5 หลายเดือนก่อน +7

    looked 4 different videos then came here for the tower of hanoi problem and understood it in one go amazing...just amazing

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

      if you understand can you explain me this one please

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

      @@anwarbasha5073 watch the vedio of tap academy on tower of hanoi.They explained it very well graphically.

    • @nubguy8219
      @nubguy8219 20 วันที่ผ่านมา

      Same man really clear here

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

    # TOWER OF Hanoi
    # Python Version
    def tower_of_hanoi(n,src,helper,dest):
    if (n==1):
    print("Transfer Disk {0} from {1} to {2}".format(n,src,dest))
    return
    tower_of_hanoi(n-1,src,dest,helper)
    print("Transfer Disk {0} from {1} to {2}".format(n,src,dest))
    tower_of_hanoi(n-1,helper,src,dest)
    tower_of_hanoi(3,"S","H","D")
    Thanks for nice explaination.

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

    aapke saari videos mere future mai most probably help karne wali hai..so thanks in advance.....ab coder banna hai and mba grad se jyaada paise kamane hai

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

    Such an interesting and easy method of teaching the hard topic with ease.Great !

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

    Amazing ... just amazing 🔥🔥
    got each bit of it... the most important problems of recursion... widened my view over recursion...
    Thank u soooOoo muchhh for such an amazing lecture.... love from Kashmir ❤️

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

    i think there is some sort of mistake in problem no. 3, let's assume we had passed string as "bab" here when it check for first it will only modify first, because you have give last as the else statement... Even though it's output should be first - "1 index" and last- "1 index", it will be first -"1 index" and last as "-1 index ( initialised value )"
    solution - you can just add last=first in the if loop, i think that solves it

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

    The way aman bhaiya response to feed backs is awesome like recursion part was not so well explained in the cpp course but here we are

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

      yeah definately, i was really stucked at cpp playlist after recursion . But here it is.....

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

    Thank you Microsoft wali didi & also OP🙏🙏😊😊😊

  • @ShivamKumar-zj8bp
    @ShivamKumar-zj8bp 3 ปีที่แล้ว +406

    Didi please make a full course on android devlopment begeniers to advance with real life project 🔥🔥🔥

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

      Exactly bro.

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

      Haa really we need this

    • @MO-fg2cm
      @MO-fg2cm 3 ปีที่แล้ว +29

      Go find some other courses ... Don't wait for them to do ..

    • @Mohit-dk4jx
      @Mohit-dk4jx 3 ปีที่แล้ว +1

      Yes we need such courses

    • @ajay-iy4xb
      @ajay-iy4xb 2 ปีที่แล้ว +1

      I want also bro

  • @prashantMishra-it2im
    @prashantMishra-it2im 3 ปีที่แล้ว +23

    This is the best way to explain which builds intuition and logic...thank u so much for your efforts 😇😇

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

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

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

    Thankyou for building logic and intution for such an difficult topic.VERY MUCH CLEAR AND ABLE TO SOLVE QUESTIONS ALSO.. You are amazing❤️❤️❤️

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

    Thanx a lot , the lecture from c++ course was very difficult to cope up with👍👍😊

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

    I am an it professional and still I watch your videos... They are helpful to relearning things

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

    Really nice explanation of tower of Hanoi problem 👍👍

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

    19:43 __ I appreciate your effort but you did some mistakes 1. Base case - why for 1 disk it will for zero our program can run for 1 disk also so base case will be -> if(n == 0) {
    return; }
    2. Parameters - Passing parameter will be S D H instead of S H D like -> towerOfHanoi(n, "S", "D", "H");
    now, this is the right sequence (*You can visualize and relate with lecture also)->
    transfer disk 1 from S to D
    transfer disk 2 from S to H
    transfer disk 1 from D to H
    transfer disk 3 from S to D
    transfer disk 1 from H to S
    transfer disk 2 from H to D
    transfer disk 1 from S to D

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

      @peanutButter if I pass S H D in this program
      This will return
      transfer disk 1 from S to D
      transfer disk 2 from S to D
      transfer disk 1 from D to H
      transfer disk 3 from S to H
      transfer disk 1 from H to S
      transfer disk 2 from H to S
      transfer disk 1 from S to D
      Where S is src and H is helper nd D is Destination
      I said to visualize the output: disk 1 first goes from S (source) to D (destination), and then disk 2 will go from S (source) to H (helper), and then again disk 1 will go from D(destination) to H(helper)...nd so on this is the correct sequence... When S H D is passed as it is, the output format changes also sequence and you can see that the new output is disk 2 transfer S(source) to D(destination) where this will be the output disk 2 transfer S(source) to H (helper).

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

    Dii, you are so great teacher.. i saw java placement playlist and i understand java very well thank you very much.😇

  • @AakshitaSingh
    @AakshitaSingh 8 หลายเดือนก่อน +4

    There is an error for the question - First and Last Occurrence using Recursion, the method you stated is suitable when the first and last occurence is different but if there is only one occurence then it fails to give the right answer as it gives -1 for the last occurrence. Here is the corrected code:
    if (str.charAt(index) == c)
    {
    if (first == -1 && last == -1){
    first = index;
    last = index;
    }
    else
    last = index;
    }

  • @Anonymous-qr5pz
    @Anonymous-qr5pz 2 ปีที่แล้ว +10

    Thanks for such great explanation. Now I am pretty much comfortable in recursion. You are doing a great job.

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

      Are you a school student?

  • @stable577
    @stable577 ปีที่แล้ว +8

    33:06 (logic of initializing idx=-1 ), 47:46(array sorting code can be optimized)

  • @avanish_shaw
    @avanish_shaw 5 หลายเดือนก่อน +7

    my mind suffered in pain after listing to the first explaination of tower of hanoi

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

    Wow I didn't know it before that god "Brahma Ji" himself created tower of Hanoi algorithm ! 🙄 1:04

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

    MY APPROCH FOR MOVING ALL "X" TO END OF THE STRING:
    public static void shiftExToEnd(StringBuilder str, int i){
    if(i==str.length()-1){
    System.out.print(str);
    return;
    }
    if(str.charAt(i)=='x'){
    str.delete(i, i+1);
    str.append("x");
    }
    shiftExToEnd(str, i+1);
    }

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

      Delete ki jagah substring bhi use kar sakte ho

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

      this code is give wrong output in some cases

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

    The way of teaching is incredible 🎉

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

    My fear for recursion all gone . thank you.i am literally enjoying it now 😊❤

  • @hishrey
    @hishrey 4 หลายเดือนก่อน +5

    Thank u so much mam
    i had to clear the phone combination problem which i was stuck at from a long time....
    and now it is clear to me by your valuable way of teaching....😊

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

      Can you explain me the dry run of keypad combination

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

    Thanks ma'am,❤
    I am very grateful to you, for you making me understand complex programs and also making me do the hardwork.willingly, due to your quality of teaching.

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

    Thanks so much. I learned so much about recursion through this and the previous video.

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

    This video helped me understand Tower of Hanoi clearly, thanks for the tutorial

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

    Last one was tough to understand without getting the concept of oops first. this video is sure tough for beginners who's giving efforts but still not in right order

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

    My Fav Question Was TowerOfHanoi, Find Occurance & Print Keypad Combination 😊

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

    First que kitna easy hai par uska itna easy tarike se samjaya ki aisa laga 2 no. Ko plus krna hai bohot ache se explain krti hai didi or aman bhaiya is course mai jlde video apload kro daily ek

  • @Shriram-y9v
    @Shriram-y9v 3 วันที่ผ่านมา +3

    In Occurance of an element code problem if their is only one 'a' then last print -1🤖

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

    You explain in super way. Thanks a lot for the explaining this complex problem in very easy way.

  • @niteshsingh-ii5hx
    @niteshsingh-ii5hx 2 ปีที่แล้ว +5

    loved this video ! cleared all doubts on recursion.

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

      ! Cleared or its cleared 😂

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

    as alpha student this video still helps alot
    Thanks Shraddha mam

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

    Excellent teaching on recursion mam

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

    Didi what an explaination !!! amazed
    but first question concepts is not mythology we are proud to be Hindu jai shree Ram

  • @pankajsingh-cn3ec
    @pankajsingh-cn3ec 2 ปีที่แล้ว +1

    New Approch or My Approch : first of all mam u r an awesome teacher . Please let me know what i m thinking us better or not.
    Ques. Remove duplicate string.
    My perception-> In this as per your code every time we have to check every element for atleast 26 times. But we can get new array string[e.g->New_array] which is empty and then we compare it from out input char one by one if the char is not available we will add it and then again we compare next char from New_array and add if its already not availabe. In this method we don't have to compare it 26 time for every elements until we got last 26th element (for which also we have to compare it for once only because we out New_array length got length of 26 we will return and close the program ).And you told its time complexity is O(n) but its comparing every element atleast for 26 time so its complexity should be O(n square ) or something else which i don't know (as i have started this topic today only ). Please let me know i m correct or not.
    Also we doesn't require bool array. #memorysave #issue #complexity #tle #timelimitexced #AmanBhaiyaop #AmanBhaiyaThankYou #thankyoudi

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

      Can you provide me with the 1st part of this video plz.

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

    Ma'am sacchi aap bhut accha pdati hooo mja aa jata hai ek baar mai h topic clr hoo jate hai bs aap ds algo using java ki classes or lelijye

  • @subham5267
    @subham5267 26 วันที่ผ่านมา +1

    41:11 - Check if the array is sorted (strictly increasing)
    public class arr_sorted {
    public static boolean arr_sort(int arr[], int ind){
    if (ind == arr.length) {
    return true;
    }

    if (arr[ind]==ind+1) {
    return arr_sort(arr, ind+1);
    }else{
    return false;
    }
    }
    public static void main(String[] args) {
    int arr[]= {1,2,3,4,5,5};
    System.out.println(arr_sort(arr, 1));
    }
    }

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

    Thanku sister free me coding shikhane ke liye

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

    This is a much better code to reverse a string. Taken from - A Common Sense Guide to DSA
    public class chk
    {
    public static String reverse(String s)
    {
    if(s.length()==1)
    {
    return s;
    }
    return reverse(s.substring(1,s.length()))+s.charAt(0);
    }
    public static void main(String[] args)
    {
    String s="hanuman";
    System.out.println(reverse(s));
    }
    }

    • @AmarKumar-nf3nn
      @AmarKumar-nf3nn ปีที่แล้ว

      Same code is given in the notes of this lecture

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

    Yaar kitna achaa padhaati hai didi 😍

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

    You take index of string from 0 to string.length()
    But I think it should be from 0 to String.legth -1 and we cover every char of string

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

      right

    • @PiyushAnand-td3fl
      @PiyushAnand-td3fl 10 หลายเดือนก่อน +1

      @@felix_72 i had the same doubt as she took array.length-1 in the next problem

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

    Great explaination!!!

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

    Best Recursive Explanation is at 56:55 "in the bottom right corner". xdxd

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

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

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

    Didi pls take live class for C++ programming pls didi😊😊😍😍😍

  • @SaiKeerthana-u2s
    @SaiKeerthana-u2s 10 หลายเดือนก่อน

    Your videos are truly wonderful, but could you kindly assist us by including English subtitles? It would greatly benefit those who may not understand Hindi.

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

    How to calculate the number of steps needed for n disk in Tower of Hanoi
    n = 1 then step = 1
    + 2 = 1(1 is from above step) + 2 (2 is the number needed to add with 1 to get 3) = 3
    the above step can also be written as 2 ^ n-1
    n = 2 then step = 3
    + 4 = 3(3 is from above step) + 4 (4 is the number needed to add with 3 to get 7) = 7
    the above step can also be written as 2 ^ n-1 + 2 ^ n-2
    n = 3 then step = 7
    + 8
    n = 4 then step = 15
    + 16
    n = 5 then step = ?
    n = 1 then step = 1 = 2 ^ n-1
    = 2 ^ 1-1
    = 2 ^ 0
    = 1 steps
    n = 2 then step = 3 = 2 ^ n-1 + 2 ^ n-2
    = 2 ^ 2-1 + 2 ^ 2-2
    = 2 ^ 1 + 2 ^ 0
    = 2 + 1
    = 3 steps
    n = 3 then step = 7
    + 8
    n = 4 then step = 15
    n = 5 then step = ?
    when n = 4
    = 2 ^ 3 + 2 ^ 2 + 2 ^ 1 + 2 ^ 0
    = 8 + 4 + 2 + 1
    = 15 step when n = 4
    if you didn't understand then
    docs.google.com/document/d/1Jr0ai4ADbLVvi4-FVURU5qsilL4zybOiAPT14PgyASA/edit?usp=sharing
    Hope you understand now ^_^

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

    God help those who help themselves.

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

    Buckup Girl, you are the combined force of Goddess Parvati-Laxmi-Saraswati👍👍👍

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

    Another way for question 6 without use of boolean array Hope it helps
    import java.util.*;
    public class MBrenXI10 {
    static Scanner sc = new Scanner(System.in);
    public static void convert (String blank, String d, int n, int x){
    int count = 0;
    if (n==x){
    System.out.println(blank);
    return;
    }
    else {
    for (int i = 0; i

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

    Good teacher you all 👌👌👌

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

    what a blunder in notes of the tower of hanoi !

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

    For unique subsequences, arrayList is enough as arrayList has contains method (hashSet wasn't required)

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

    I can't believe it...........never saw any teacher teaching programming feeling like NV SIR teach physics right now 😯✅😍

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

      Can you provide me with the 1st part of this video plz.

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

      ​@@shashwatsingh479 of course

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

    great video ,explanation is neat and understandable

  • @mr.detecto1955
    @mr.detecto1955 ปีที่แล้ว

    Python recursive code for reversing string:
    string = input("enter string: ")
    index = len(string)-1
    def rev_str(index, string):
    if index==0:
    print(string[index])
    return
    else:
    print(string[index], end="--->")
    rev_str(index-1,string)
    # calling the function
    rev_str(index,string)

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

    Thanks very much for your efforts.🙂

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

    54:00 short and better approach. This code will work for any input character
    public static void transferCharacters(String str, char ch, int index, String helperString, String moveAllchars){
    // helperString will store all the cahracters other than ch
    // moveAllchars will store all the occurances of that particular character
    if(index < str.length()){
    if(str.charAt(index) == ch) transferCharacters(str, ch, index+1, helperString, moveAllchars + ch);
    else transferCharacters(str, ch, index+1, helperString + str.charAt(index), moveAllchars);
    }
    else{
    System.out.println("new string of all transferred " + ch + " " +(helperString + moveAllchars));
    return;
    }
    PS : also, time complexity is minimum in this code O(n) without roundoff or ignoring some integer

  • @ranvijaypatel3213
    @ranvijaypatel3213 6 หลายเดือนก่อน +2

    There is some mistake in FirstAndLast Occurrence Question:
    Here is the correct code ->
    static int first = -1;
    static int last = -1;
    public static void firstAndLast(String str, int index, char element) {
    if(index == str.length() ){
    System.out.println("First: "+first + " Last: "+last);
    return ;
    }
    if(str.charAt(index)==element && first==-1){
    first = index;
    last = index;
    }else if(str.charAt(index)==element){
    last = index;
    }
    firstAndLast(str, index+1, element);
    }

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

    Didi is the best 😊 I means 'ek number' 👍

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

    I love this channel....❤️

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

    In occurrrance of the element in the string problem ,I think the code will not work properly in some cases where a element has occurred only once in the String.

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

      Add last=idx also in the first ==-1 if

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

    Thnx didi for this amazing lecture

  • @ANKITKUMAR-vx2ej
    @ANKITKUMAR-vx2ej ปีที่แล้ว

    lots of love ❤... #best coder

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

    If input string is "abcd" , your code will print first as 0 and last as -1 So, you need to assign first and last both with idx value inside if condition. And later last variable will be updated inside else if more occurances are there of the character 'a'.

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

      True that. Nice observation. Thanks.

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

    45:54 why are putting return after calling the isSorted function again??

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

    Didi thanks for sharing your knowledge and guidance

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

    for removing duplicate we can use string builder as well

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

      Is there a predefined function for that?

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

    Awesome teacher plzz use this potential of urs..... it feels so bad by seeing this channel is doing nothing....where others are taking the first mover advantage

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

    In the remove duplicate question if we use indexOf method of string the problem will much easier...😊

  • @rajiv-59
    @rajiv-59 2 ปีที่แล้ว +2

    mam great explaination of recursion ...................you didn't describe recursion so well in c++ placement course.......................

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

    30:00 For a better understanding of how stacks are implemented while using recursion, use this:
    public class Main
    {
    public static void printRev(String s, int x=0){
    if(x==s.length()){
    return;
    }
    printRev(s, x+1);
    System.out.print(s.charAt(x));
    }
    public static void main(String[] args) {
    String s="abcd";
    printRev(s, 0);
    }
    }

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

    Shradda, in notes, there is a typo in TOWER OF HANOI.
    in line no. 8, instead of using dest, you used helper.

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

    if we consider a counter variable to count the steps . Then how to implement it, in the program??

  • @Rieshu-s1m
    @Rieshu-s1m 9 หลายเดือนก่อน +1

    #Apna College & Shradda didi rocks

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

    this is called premium course

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

    59:20 you can also use java builtin String method .replaceAll() to replace all the occurances of a character with a new character
    public static void removeDuplicates(String str, String newStr, int index){
    // newStr will only store unique characters
    if(index < str.length()){
    if(str.charAt(index) != '#'){
    newStr += str.charAt(index);
    /* before replacing, first of all we will convert that particular character into string
    * (as replaceAll will only accept (String, String) as arguments */
    str = str.replaceAll(String.valueOf(str.charAt(index)), "#");
    removeDuplicates(str, newStr, index+1);
    }
    else
    removeDuplicates(str, newStr, index+1);
    }
    else{
    System.out.println("new String : "+newStr);
    return;
    }
    }
    PS : for someone who have question that what if string contains '#' as character. As per question and solution which she has written String only contain alphabets

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

    Plz make a videos on C for beginners in CSE

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

    Thank you so much for this video.

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

    In question first and last occurence it is failing for the input abbbccc for element a the correct code will be:
    public static void findOccurence(String s,int idx,char element)
    {
    if(idx==s.length())
    {
    System.out.println(first);
    System.out.println(last);
    return;
    }
    if(s.charAt(idx)==element)
    {
    if(first==-1){
    first=idx;
    last=idx;
    }
    else
    last=idx;
    }
    findOccurence(s,idx+1,element);
    }

  • @Hospsite
    @Hospsite 9 หลายเดือนก่อน +1

    Disk numbers should be from top to bottom 1 on top and 3 at bottom. Thank you

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

    I think at 39:12 its
    if(idx == str.length() -1)
    because we idx starting from 0 so we need to go till last index that is str.length()-1

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

    In first and last occurence,
    if(first== -1) {
    first = index;
    last = index;
    } else
    last = index;
    Otherwise if a string has target char once it'll show -1 for last occurence which is not true

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

      if(first== -1) {
      first = index;
      }
      last = index;
      else is not required only.

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

    Beauty + Brain = Didi
    Thank you for such valuable information !!!!
    btw aapka naam kya hai ?

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

    Tower of Hanoi-
    Easy Version to Understand-
    Just replace src= A
    helper= B,
    dest= C
    and then rest is the same
    public static void towerOfHanoi(int n , String A, String B, String C){
    if(n==1){
    System.out.println("Transfer Disk "+ n + " from " + A + " to "+ C);
    return;
    }
    towerOfHanoi(n-1,A,C,B);
    System.out.println("Transfer Disk "+ n + " from " + A + " to "+ C);
    towerOfHanoi(n-1,B,A,C);
    }
    public static void main(String args[]) {
    int n=3;
    towerOfHanoi(n, "A", "B", "C");
    }

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

    Didi! Please make a video on "Different Ways to Get into IISc and Different Job Opportunities adter doing B.S./M.S. from there."🙏🏻

  • @anu.jangra
    @anu.jangra 3 ปีที่แล้ว

    Thank you , Microsoft wali didi ,,,,

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

    Hii too good for giving this information

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

    Bhaiya please make whole course of C programming language..,,,,from basic to advanced....

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

    how many got to know that tower of hanoi problem is different in lecture and notes provided by mam . by the way thank you mam for this much detail on tower of hanoi . the code in notes is incorrect instead of dest it is helper.

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

    Thank you so much for your efforts ❤

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

    At 20:00 didi ne to waqt badal diye, jazbbat badal diye, halat badal diye 🤣.....
    Didn't expect that.....🥲🥲🥲

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

      Exactly bro, output thik nhi aaye hat is code k?

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

    Python solution for tower of hanoi
    def printMove(sou, des):
    print('move from ' + str(sou) + ' to ' + str(des))
    def Towers(n, sou, des, hel):
    if n == 1:
    printMove(sou, des)
    else:
    Towers(n-1, sou, hel, des)
    Towers(1, sou, des, hel)
    Towers(n-1, hel, des, sou)
    print(Towers(4, 'P1', 'P2', 'P3'))

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

    mujhe pata hai aap log comment to padenge nahi lekin mai phir bhi likhna chaunga ki didi aap python ka bhi tutorial bana do ek

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

    I think you should initialize first and last variable both when character is found, because if a character occurrence is only one then your code will give first = non-negative and last = -1.... In find first and last occurrence

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

      Video bhi vahi hena
      Tho idhar puchne ka zarurat kya hai

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

    REcursion is hard to learn it messes with your mind on whole other level