Merge two sorted Arrays into a third Sorted array

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

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

  • @MrKabutoSN
    @MrKabutoSN 4 года назад +27

    I had been trying to solve this problem all day long, thank you so much for the explanation!

  • @JAI-cf2xt
    @JAI-cf2xt 2 месяца назад

    Very clear explanation sir..
    The way you explain the concept makes me understand the logic of the program in the clear manner...
    Thanks a lot

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

    Thank u so much bcoz of u I finally understood coding for merger sort..

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

    Your explanation is sooooo good. I tried to solve this problem for the entire day and then I saw this vid.

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

    Very clearly explained.. I was looking for this kind of. No constraint that both array of same size. Thank you so much

  • @riyanshsrivastav5107
    @riyanshsrivastav5107 3 месяца назад +1

    Very cleanly explained sir
    Thank you very much

  • @aksharaverma6452
    @aksharaverma6452 3 года назад +3

    best ever explanation!!!😍 crystal clear concept.. Thankyou very much sir!!

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

    very very very thanku sir
    u r great
    u passed successfully explaining this complicated topic in too too simple manner......thanku so much

  • @dhritika-j2t
    @dhritika-j2t 4 месяца назад

    thank you sir for such a good explanation. I'm finally able to understand all these questions.

  • @pooja2023
    @pooja2023 6 лет назад +6

    Tomorrow is my exam and I faced a lot of problem in this program but after watching this video everything is clear .

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

    Thanks for uploading it.. You are doing a great job.. Please upload more videos of competitive programming.. We really need it

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

    Thanks I was stuck from last three hour and you made me solve this in just few minutes thanks

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

    This is an amazing walkthrough of the process 😀 Thank you!

  • @Man-if5xt
    @Man-if5xt 6 лет назад +4

    Thoroughly explained as always. Thank you!

  • @ThePhani2585
    @ThePhani2585 6 лет назад +6

    nice explanation.Plz do continue posting videos...

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

    It is a Great job, which you are doing!.. Keep Sharing

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

    Nice work... nicely explained..thanks sir

  • @dantewhite1818
    @dantewhite1818 6 лет назад +4

    its like a light just beamed down on my had wow so impressive thanks for this awesome vide you absolutely rock for this thanks for explaining what happens at each interval thanks thanks thanks thanks thanks thanks thanks thanks thanks

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

    this video like ayurvedic medicine for me, amazing sir. thanks for this video

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

    Good explaination sir,helped a lot thankyou

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

    Thanks you from Senegal ❤❤❤ God bless you

  • @sudharsanprabu
    @sudharsanprabu 4 года назад +10

    I think you will have to add a condition for both elements being equal. In that case copy the value and increment i, j and k.

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

      no that condition is not required
      because condition evaluates to true or false in this case it will evaluate to false which is correct logicaly

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

    your explanation way is very fantastic thank you sir

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

    Thanks so much for many time iam tried to under this but i can't
    But this vedio is very help full for me 😘❤

  • @antoniskelekis2286
    @antoniskelekis2286 5 лет назад +21

    Some of my friends asked who is this guy talking like this, i said he is the one who helped me under stand how to solve the problem you didnt. :/

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

    Best explanation sir 🔥😀..Thanks a lot sir for these solutions ❤️

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

    Great explaination sir you are making me understand DSA very well thankyou need new updates

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

    I love you and thank you bro 🤧🤧
    Finally i understand so clearly

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

    Very easy explanation ! thank you 😍🤩

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

    Mast samjae re baba ...dimag chamk gya 😘😘😘❤❤

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

    Great explanation🙌

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

    very well explained boss. thanks

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

    This was such a good explanation!

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

    Very very osam explanation. God bless you

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

    You can achieve same using || condition in while loop and check first if condition as i

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

    Sir Your explanation is awesome.please do more videos on interview based questions.

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

    Such a great explanation!
    Thank you.!

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

    Superb explanation

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

    clear and best explanation

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

    good implementation of 2 pointer approach

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

    Nice explaintion sir..thanku so much.

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

    Good expalnation sir. Ii is Easily understood ..👍

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

    well explained it was very helpful thank you

  • @dondlabhanuprakash1458
    @dondlabhanuprakash1458 6 лет назад +2

    Excellent video sir

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

    superior explaination!!!!!!!!! great work dude :-)

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

    sir thanks alot from qasim lahore pakistan

  • @nagarajumuddey465
    @nagarajumuddey465 6 лет назад +2

    Super.....sir add more videos this type

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

    Excellent explanation, please also explain how to merge n sorted array into an array

  • @SAURABHSINGH-od7tp
    @SAURABHSINGH-od7tp 6 лет назад

    Excelent explanation👍👍👍

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

    nice one sir, keep it up 👍👍

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

    sir....you are the best

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

    you explains very well 😍😍

  • @04.nehalsingh12
    @04.nehalsingh12 3 года назад

    awesome tutorial sir

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

    Thank you for this, was too helpful!

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

    nice explanation sir

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

    I owe you, you saved my life

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

    Great Explanation sir!!

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

    This indian man is the best!

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

    Thanks a lot sir 😊✨🙏

  • @494venkatraja4
    @494venkatraja4 4 года назад +1

    sir,i have this doubt what should we do if we encountered the situation where where we have two same numbers ...?.

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

    thanks alot bro ,it is really helped me..

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

    this is really good...thank you sir

  • @sujitamin949
    @sujitamin949 6 лет назад +2

    excellent explaination

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

    excellent explanation! thanks!! I've subscribed :)

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

    You help me a lotttt!!! thank you very much

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

    Sir can u please do a video on algorithm for merging 2 arrays into a third array in descending order.

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

    Thank u sir nice explanation

  • @kashifkamran6274
    @kashifkamran6274 5 лет назад +6

    sir what will happen if two elements are equal in arrays

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

      the else statement covers the condition in which the two elements are equal to one another. for example, 0,1,2,3 and 0,4,5,6. it will hit the else statement, see that 0 is not less than 0 (first if statement), then hit the else statement adding the element in array 2 to the resultant array. Sorry if this is a bad explanation.

    • @168Abhinav
      @168Abhinav 4 года назад

      If there r duplicates then only one element will be copied
      Its wrong algorithm

  • @34adnanali26
    @34adnanali26 3 года назад

    nicely done sir

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

    Took me 5 minutes to realise if he is speaking English
    P.S: no hate comments just saying

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

    Its clear now, thanks sir 👍🏼

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

    you are amazing sir

  • @HarshSharma-rf7fk
    @HarshSharma-rf7fk 4 года назад

    Sir aap haste boht accha hoo 🤣🤣🤣😅

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

    Nicely explained

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

    Will it work if arrays have same elements?

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

    Great video!!!

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

    nice explanation.

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

    simple and nice explaination

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

    Am I correct to assume that you need another if, else in the even that two of the indices in arr1 and arr2 carry the same integer. If so can anyone elaborate where and how that should be implemented? Do you just change the third line to: if(arr[i]

  • @nands4410
    @nands4410 6 лет назад +6

    Merge procedure of merge sort

  • @HieuTran-mz6fp
    @HieuTran-mz6fp 3 года назад

    Thank for ur explanation

  • @mohammad-karbalaee
    @mohammad-karbalaee 4 года назад

    your knowledge is appreciated but if your accent was more understandable it would be perfect. anyway, thanks for this tutorial vid

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

    What will be the result when array 1 and array 2 any element become same?

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

    awesome! nice explained

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

    if one array is sorted in ascending order and other is sorted in descending order how we can merge them

  • @SonalikaTripathy-q6i
    @SonalikaTripathy-q6i Год назад

    How Merge sort sorts the following sequence of keys in ascending order 12,22,33,44 48,56,57,65,76,84 with neat diagram representing sequence of recursion calls. Explain its time complexity

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

    why we are not checking for equals to if s1==s2

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

    Great explanation!

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

    i followed this example in java in it only sorted the elements up until 9 this was a good start but it doesn't work

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

    does it handle duplicates in two input??

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

      It wont remove duplicates.

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

      ruclips.net/video/gf7vdIin0dk/видео.html see this vdeo to remove duplicates... apply this after the merge sort🤗

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

    Hi, sir what if the second array of last four elements are not sorted then, the resultant array will not be sorted.?

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

    Please tell the algorithm of printing the series of prime numbers from 2 to the number asked by the user

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

    tnxx. it was really helpfull.

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

    Please write the piece of code for printing that merged array.

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

    I think the last two lines have mistake
    There shouldn't be i++ k++ in braces but out of them
    It shoulď be res [k] like that not k++
    Before while loop got terminated k already got incremented and when entering last while loop at end k got incremented again leaving a blank slot

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

    very well explained.

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

    how can we merge these two arrays using the for loop?

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

    How can we decide whether the remaining elements in the left over are sorted??
    How can we just copy paste

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

      Shaik, we are not sorting here.. if both the arrays are sorted, then only this solution will work. for unsorted arrays we can not use this technique

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

    How to merge multiple sorted array into one sorted array, could you please give an example

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

    Meri taraf se aapko ek gheeli chummi 😂🙏💯

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

      XD bhai.. video bna na bnd kr denge wo esa mat kro XD