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
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]
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
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.
Great video, just a question though....When one element ( i is not less than the arrays size ) condition fails. Then you go to the other array and store the remaining values into the resulting array. I get that but, what if the remaining values are not sorted? would you not have to compare them with one and other?
Syrenitey the algorithm stops working once one array is empty meaning its not possible for it to go to the second while with both arrays holding values and since both arrays are sorted u can simply copy and paste to the sorted array
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
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
I had been trying to solve this problem all day long, thank you so much for the explanation!
same here ;-;
Same 😀
sam
Very cleanly explained sir
Thank you very much
Very clearly explained.. I was looking for this kind of. No constraint that both array of same size. Thank you so much
Your explanation is sooooo good. I tried to solve this problem for the entire day and then I saw this vid.
Thank u so much bcoz of u I finally understood coding for merger sort..
Thanks for uploading it.. You are doing a great job.. Please upload more videos of competitive programming.. We really need it
best ever explanation!!!😍 crystal clear concept.. Thankyou very much sir!!
This is an amazing walkthrough of the process 😀 Thank you!
Thoroughly explained as always. Thank you!
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.
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
It is a Great job, which you are doing!.. Keep Sharing
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
same here..
thank you sir for such a good explanation. I'm finally able to understand all these questions.
Thanks I was stuck from last three hour and you made me solve this in just few minutes thanks
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. :/
Thanks you from Senegal ❤❤❤ God bless you
nice explanation.Plz do continue posting videos...
Tomorrow is my exam and I faced a lot of problem in this program but after watching this video everything is clear .
🙄🙄🙄
very very very thanku sir
u r great
u passed successfully explaining this complicated topic in too too simple manner......thanku so much
sir,i have this doubt what should we do if we encountered the situation where where we have two same numbers ...?.
Nice work... nicely explained..thanks sir
good implementation of 2 pointer approach
Great explaination sir you are making me understand DSA very well thankyou need new updates
very well explained boss. thanks
this video like ayurvedic medicine for me, amazing sir. thanks for this video
Such a great explanation!
Thank you.!
Would you like to donate your hair...we cud pay you in cash
This was such a good explanation!
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]
You can achieve same using || condition in while loop and check first if condition as i
I owe you, you saved my life
Will it work if arrays have same elements?
clear and best explanation
Good explaination sir,helped a lot thankyou
Thanks so much for many time iam tried to under this but i can't
But this vedio is very help full for me 😘❤
Great explanation🙌
I love you and thank you bro 🤧🤧
Finally i understand so clearly
Sir Your explanation is awesome.please do more videos on interview based questions.
nice one sir, keep it up 👍👍
Great video!!!
Excellent explanation, please also explain how to merge n sorted array into an array
What will be the result when array 1 and array 2 any element become same?
your explanation way is very fantastic thank you sir
Super.....sir add more videos this type
Best explanation sir 🔥😀..Thanks a lot sir for these solutions ❤️
Mast samjae re baba ...dimag chamk gya 😘😘😘❤❤
Superb explanation
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
Thank you for this, was too helpful!
sir what will happen if two elements are equal in arrays
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.
If there r duplicates then only one element will be copied
Its wrong algorithm
Sir can u please do a video on algorithm for merging 2 arrays into a third array in descending order.
Excellent video sir
if one array is sorted in ascending order and other is sorted in descending order how we can merge them
Very easy explanation ! thank you 😍🤩
superior explaination!!!!!!!!! great work dude :-)
awesome! nice explained
does it handle duplicates in two input??
It wont remove duplicates.
th-cam.com/video/gf7vdIin0dk/w-d-xo.html see this vdeo to remove duplicates... apply this after the merge sort🤗
why we are not checking for equals to if s1==s2
excellent explaination
Nicely explained
Merge procedure of merge sort
Great video, just a question though....When one element ( i is not less than the arrays size ) condition fails. Then you go to the other array and store the remaining values into the resulting array. I get that but, what if the remaining values are not sorted? would you not have to compare them with one and other?
Syrenitey the algorithm stops working once one array is empty meaning its not possible for it to go to the second while with both arrays holding values and since both arrays are sorted u can simply copy and paste to the sorted array
Hi, sir what if the second array of last four elements are not sorted then, the resultant array will not be sorted.?
You have to intialised both the arrays as sorted
awesome tutorial sir
sir....you are the best
Please tell the algorithm of printing the series of prime numbers from 2 to the number asked by the user
This indian man is the best!
Very very osam explanation. God bless you
nicely done sir
nice explanation.
Thank for ur explanation
sir thanks alot from qasim lahore pakistan
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
Great Explanation sir!!
Good expalnation sir. Ii is Easily understood ..👍
well explained it was very helpful thank you
very well explained.
how can we merge these two arrays using the for loop?
your knowledge is appreciated but if your accent was more understandable it would be perfect. anyway, thanks for this tutorial vid
Its clear now, thanks sir 👍🏼
Please write the piece of code for printing that merged array.
How can we decide whether the remaining elements in the left over are sorted??
How can we just copy paste
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
Thank you sir!
Excellent
Hi Mr. Vivekanand , I'm facing problem in Java program where I have to merge the arrays and sort it in descending order . Please help
Excelent explanation👍👍👍
thanks you are the best
excellent explanation! thanks!! I've subscribed :)
Nice explaintion sir..thanku so much.
Hello sir what we have to do when array1 and array2 are not sorted
nice explanation sir
How to merge multiple sorted array into one sorted array, could you please give an example
Great explanation!
Very helpful!
you explains very well 😍😍
You help me a lotttt!!! thank you very much
simple and nice explaination
Thanks a lot sir 😊✨🙏
you are amazing sir
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