Merge Sort Algorithm | How Merge Sort Works (Example Diagram) | Part - 1 | Sorting Algorithms - DSA
Vložit
- čas přidán 5. 09. 2024
- Understand or Merge Sort sorting algorithm works with easy example & visual diagram. We will dry run the merge sort algorithm step by step by taking a diagram example to understand the flow of the algorithm at every step.
Theory -
1. Merge Sort is a Divide and Conquer algorithm.
2. It divides input array in two halves, calls itself for the two halves(recursively) and then merges the two sorted halves.
3. A separate merge() function is used for merging two halves.
4. Merge sort is one of the most efficient sorting algorithms.
5. Time Complexity: O(nlog(n))
---------------------------------------------------------------------------------------------
Full DSA playlist - • Introduction to Data S...
Full Code & Theory article - simplesnippets...
C++ Programming Tutorials for Beginners Course - • Introduction to Comput...
---------------------------------------------------------------------------------------------
Support Simple Snippets by Donations -
Google Pay UPI ID - tanmaysakpal11@okicici
PayPal - paypal.me/tanmaysakpal11
---------------------------------------------------------------------------------------------
Simple Snippets Official Website -
simplesnippets....
Simple Snippets on Facebook -
/ simplesnippets
Simple Snippets on Instagram -
/ simplesnippets
Simple Snippets on Twitter -
/ simplesnippet
Simple Snippets Google Plus Page -
plus.google.co...
Simple Snippets email ID -
simplesnippetsinfo@gmail.com
For More Technology News, Latest Updates and Blog articles visit our Official Website - simplesnippets....
#mergesort #sortingalogrithms #dsa #divideandconcquer #algorithms
Best explaination of the recursion part..... haven't seen this much detailed explanation for recursion in any other CZcams video
Thank you so much buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
You are true bro ...
Yes, agreed. So many simple overviews out there that don’t give the true flow of the recursion, which results in a total misunderstanding of how recursion works in general. But this explanation is Outstanding!!! Thanks very much.
100% TRUE NO BODY EXPLAINED ABOUT RECURSION EXPECT YOU
Such a premium content.
Even expensive courses are not upto this level.
Keep up the good work man!
U have talent in such a way that even a beginner can understand the concept so clearly.Thank you so much.God Bless💯☺️
Thanks a lot 😊 It would mean a lot if you could please share our channel and videos with your friends too ✌
@@SimpleSnippets Sure Bro!! I have a small request please make more videos on file handling and exception handling in c++
Spent 4 days, understanding this algorithm, most other video gives theoritcal concept without the in-depth analysis, your video is best because the way you explained the pause part that's where I could not go forward initially. You are meditative.
Glad it helped! Thanks for such a wonderful feedback Dinesh. Means a lot. Please support me by sharing the videos with your friends too!
I don't know why this video is underrated. This video is very deep and clear. He showed what is happening behind the scenes which many teachers on youtube did not explained in their videos and had so much views.
Great Job man. I was looking for this kind of explanation.
Thanks Shivam. Really glad to see such genuine appreciation and feedback♥️😊
yes. you are right
I just finished my Data Structures course and wanted to explore algorithms in my free time, beautiful explanation. You explain these concepts like a university professor!
*better than university professor
Great to hear!
I have to do a presentation in class about this algorithm and I stubled unpon your video trying to understand it better. I have to say, this is one of the best explanations I have ever heard about anything. Great job man, going through all the steps the program go through was REALLY helpful. Have a great day.
I watched this one year ago and came here back today and I must say you are great sir! Thank you, your channel definitely deserves more subscribers, views and likes, always count on my support❤️
Tanmay: "Make sure to keep your phones aside."
Me watching this on phone:
'Error 401'.
Lol 😂
Uff!! finally watched 52min video in 2hour in single sitting 😅 thank you so much for clearing my whole confusion on recursion and merge sort ❤️❤️ god bless you brother!
No words to say , i think some people have kind of special gift, if they explain everyone will understand . You are one of them
Thank you so much Puneeth bro this means a lot 🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
The person who disliked this is a commerce student who came here by mistake !
😂😂😂😂😂😂 good one! 😂😂😂😂
Six commerce students got in this video who's dislike it 😂 By the way - One of the best video about merge sort algorithm.
Hahaha 🤣
😂😂😂 chill savage people chill 😂😂❤️❤️
nice roast 😂😂😂
The effort that you give to explain each and every line is of GOD LEVEL. THANKS A LOT
Thanks Gargi 🙏🤩
After watching 2-3 tutorials on same topic it wasn't cleared but now it's cleared thanks for such a great explanation.
Buddy, you made it very easy to understand. Never seen such a simplified dry run for merge sort! Keep going!
I've searched all merge sort videos on youtube, but could not find a better one. Best recursion explanation ever.
I literally watched all other youtubers videos..i guess i watched atleast 7 to 8 videos but didnt understood perfectly..but by your 1 video the concept is totally clear to me. ..thanks for this amazing video😍
Now, I have a clear understanding of mergesort. I watch a lot of merge sort videos, but this clears all my doubts.
I'm glad to hear this from you Manas, please share and support my channel ✌️
Sir,,
Dil ❤️ se like kiya....
thank you..... for this wonderful explaination.....
I know , clicking on the ads is how much required
, so I always click on the ads that come in your videos....
Thats really great to know buddy🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@@SimpleSnippets I will surely support and promote your channel....
don't worry.... I will be glad by supporting you....
don't worry...I will refer your channel in every social network sites.....
Very Explained and in-depth solution of Merge Sort Algorithm !
Thank You Very Much !
Even a noob can understand merge sort from this video. Keep doing the good work brother 🙏
Always returning when I need a refresher on merge sort. Thanks again! I hope you continue to upload.
Literally the best video on the internet for merge sort. Amazing!!!!
This explanation is insane. This is what i was looking for few days. Best dry run ever. I saw so many video they just divided the array and said thats what we have to do but didn't explained the flow . Hatss of brother.
I am glad you liked it! Please do share the video with your friends too!
My tutor, thank you so much for helping me to fully understand this algorithm. I bought a course online, I don't want to name the site but the tutor could not explain like you did. Trust me your channel is worth sharing and I will share it on my Social media with friends. God bless you!
Thank you so much Albert. I'm very happy to hear this from you buddy. 😊 My tutorials are free for everyone. Please share them with everyone you know. That's the biggest support ✌️
@@SimpleSnippets the pleasure is truly mine!
Best recursion Explaination and this is how a beginner can understand very clearly.
Best explanation among the available merge sort explanations on CZcams
One of the best recursion explanations on this platform. And Merge Sort algorithm explanation was 🔥🔥🔥
Glad you think so! Thanks bro, please do share the videos & our channel with your friends too. Thats the biggest help and support you can give back to this channel! 😇
A grand salute to u brother for an efficient explanation.........Time Complexity Of Understanding- (n log n) same as merge sort.
Man .. this Dry code helps a lot. and clear everything. Love u man. I was searching for this kind of video and you have the best one indeed. please keep it up you are helping so many students
Tanmay sir , its an overwhelming moment for me , as i was trying to understand this from a long time and this was the video which made me understand the dry run of the code, tysm sir..
Thank you so much!!! This is exactly what I was looking for. I had seen many implementations of Merge Sort, but I had not understood how it was actually manipulating the array, and now I have a clear idea of what is actually happening. I wish you the best!
Glad it was helpful!
Thanks a lot Sir. Because of merge sort I hated recursion a lot. Despite knowing how recursion works, I failed to figure that out for merge sort. But today you made me love the concept of recursion.
One like isn't enough for this.
Superb explanations.
Thank you so much 😀
best explanation of merge sort.....now i have got clear understanding of merge sort
thanks for this help
Thank You So Much Sir for such a wonderful explanation. I was very confused while doing the dry run of the merge sort. Now, after watching your video, I have no doubt regarding merge sort. You have made a premium content.
this is by far the best explanation, i was confused with the recursion and this video helped me
This is the best video I've seen about this algorithm! Thanks for posting.
Woww I have no words.... this is a master class, Thank you.
Hi bro, Your Tutorial and the way of explaining everything is amazing. I really liked you Dry Run explanation it was so easy and transparent to go with the algorithm step by step. Keep it up and Hope, more interesting and exciting videos with better explanation will come soon, I am eagerly waiting for your videos. Thank you😊
Thank you so much bro😊 this was such a great feedback. And yes when it comes to data structures and algorithms, the best way to understand is to dry run each step & maybe even do it visually with diagrams. That's how we understand exactly what's going on behind the scenes. Also yes more videos coming soon ✌️ please do share the videos with your friends too ✌️😊
Well said
Jazakallah.. I couldn't find a better explaination anywhere
You give the best and smallest array that explain every piece of code
Thanks a lot 🙏
My youtube feed consists only of 2 tanmay - Tanmay Sakpal and Tanmay Bhatt. Both are legends.
Aare bhai bhai 🙏❤️ thank you so much 😊
I had to take 2 naps to complete this video, but glad I understood everything soooo well, Thank you soooo muchh!
Damn thats a lot of napping in between but its great that you understood it regardless of the breaks 😇
such a premium content, you just deeply explained the concept. thankyou sir.
Most welcome Himanshu. I'm glad you liked the quality of the content 😊❤️
It's really helpful for the people who want to know about the merge sort.. thank you
Dude I was suffering just cause of this merge function..... for the past 3 days Or so...... You're a life saver bro...
great video, you really explained this well. The walk through and step by step repetitiveness of your explaining really made this as easy as it could be to understand.
For the last two days, I was stuck in the merge sort. I watched many videos but the merge algorithm was not clear to me. Finally, I found your video and the dry run of each level helped to understand the complete merge sort algo clearly. Thank you so much for your effort. We are much obliged to you, bro.
Thank you so much for such wonderful feedback :-)
Thank you very much. A step by step explanation on what the computer does in this code which is very helpful to me and to many people. I cant thank you enough. Hope you make more videos
your lecture is 10times better than paid course, if u post videos on CP i think your channel will get next level boom!!!
Thanks a ton, and yes I am thinking about CP!
what is CP?
@@rudyf.4055 connaught place
Bro thank you so much whenever i get stuck in any coding problem you are my go to channel thank you so much god bless
vow... perfect teaching... I am a basic learner of cpp, but ur way of teaching makes me get more interested in cpp
PERFECTION ,that's what this channel is .......
The way you teach is second to none 💯🔥💯🔥
KEEP IT UP !!
Dayum son 🔥❤️ thanks bro 😊 this is too big compliment for me 🙏 Means a lot 😊✌️
Hats off!
This is the best explanation on CZcams.
Thanks.
Happy to hear this from you :-)
Very much helpful. THANKS for making it easy for us.
So much detailed explanation of the recursive functions! Badly wanted them: Thanks!
thankyou so much to to make such detail working of merge sort from last 2 days i was not understanding the merge sort working , but now i found your video and literally it cleared all my doubts, thankyou very much.....
Very happy to hear such a wonderful feedback from you 🙏❤️ please do share the video and channel with your friends too. That's the biggest support you can give back 😊
this is the best explanation ive ever come across
thanks a mill to u 👏👏👏
Thank you 🙏
Wow litrally wow What a explanation!!! This is the best explanation .Thank You very much Sirg
Have watched many videos for understanding the Merge and recursion concept and finally found the right one 👍🏻
Great to hear this Dinesh! Check out the DSA playlist for more. I think you will like it!
Best explanation, after searching for many videos , I finally understood the concept behind merge sort algorithm, step by step❤️🙏
Glad to hear that
This video is the best I’ve seen finally !!! You are a blessing thanks
You‘re doing gods work right there! I‘m getting closer to my Algorithms and Datastructures exam and I was struggling so hard with the recursion. I do understand the MS-algorithm now. After this video I will watch your vid regarding the quick sort algorithm. Thank you from Germany.
Happy to know my video helped you! Keep growing!
If possible please make video on Backtracking or String combination. Thanks in advance. Love you Bro. I never ever seen in my life this kind of explanation on youtube. Only one line for you and you hardwork *Hats off to you* 👏 💐
You helped me to gain my confidence in DSA bro....Love you a lot
amazing and really well explained.
even after explaining, I know how much struggle it takes to edit n all to create a masterpiece like this
Glad it was helpful! And yes it takes a lot of time to make these videos!
Thank You Very much . Finally understood this concept . May God bless U.
Bro you made my day I was struggling with merge sort and you have clear all my doubts 🙏
Thats great to know Aashish bro🙏 Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
@@SimpleSnippets definitely bro your method and ideas are damn good.
Bro do you have a video on graph data structure.
Much appreciated.... Hat's off to your patience level....👏👏👏👏 Thank you so much for this detailed explanation
Amazingly explained. Thank you so much
best explanation in youtube i would recommend it to my colleagues , thank you very much
Thank you for the positive feedback. Glad you liked my explanation and thank you so much for sharing it with your colleagues!
No Wonder software developers an engineers are paid a lot of money, you guys are wicked smart. Best explanation ever
Thank you so much buddy. It would mean a lot if you could please share our channel and videos with your friends too ✌
Hello Tanmay Sakpal ..... I become a fan of your teaching method and your voice and this is the first time I am appreciating a learning video. such a great work. I love your lessons and I also giving advice to my classmates that they should also learn from here. I am really really passionate from you and hoping for your success in your related field. May you achieve all happiness of life and I hope that your parents also feel proud of you
Thank you so much buddy for such a wonderful feedback. Really means a lot to me and I am happy that you are learninf from these videos. Keep sharing the videos and our channel with your friends too. Thats the biggest help ✌😇
Wtf 53 mins have already passed... Whoa!!! This is the best explanation of MERGE SORT out there. Thanks a ton, buddy :)
Best explanation on the recursion part
Thankyou very much
How merge sort work is very difficult to understand but you are ❤️❤️❤️❤️
This algo is really useful for understanding recursion
2 minute silence for the peeps who think "ye kya kaam ane wala ha"
Hahah agreed! Thank you so much for this positive feedback! And yes recursion is used in many many applications!
best video on merge sort ever the explain is too good.
the best explanation ever.
thank you so much for a detailed dry run of the code
Amazing video. Wow. This really helped me understand what's happening at each step and level. Flawless explanation. Thank you
Thanks Mike! Glad you liked it 😁
Thank you sir,finally I found the explanation of recursively part
Thanks for making merge sort so easier to understand. Thanks a lot!!!!😊
Glad it was helpful!
one of the best video for recursion murgesort
Thank you 😊
@@SimpleSnippets welcome
love it man ,i got the idea of solving within first 15min of ur video .Great man great work.
Thats amazing bro! Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇
I assure you I have watched lots of videos to understand the flow of execution :D and this is simply the best one, thank you bro !
insane bro...practically insane.Keep up the good work and thanks a lott
Thanks, will do!
Very good Visual diagram explanation, don't why you have not got huge no of views on this merge sort masterpiece.
Please help me by sharing these videos. Thats the biggest help and support. Also check the full DSA playlist. I am sure you will love it ✌
I am taking Algorithms class rn, your video about selection sort was a big help, and so are all of these. I love you man, keep up the great work!
Thank you so much Shahid 😊 very happy to hear that my videos helped you. And keep doing the great work of sharing knowledge 🤘✌️
great explaination as i anot from IT background and new to this ALGOrithm..thanks a lot and keep up the good work
Great explanation.... I haven't seen this much deep explanation of recursion on youtube or on any other platform... Well done
I would like to congratulate you, because your explanation about this algorithm was amazing! I finally understand how merge sort algorithm works just because i watched to your video. So, thank you very much!
Thank you so much Matheus, this means a lot to me. Please support me by sharing this channel with your friends too. Thats the biggest help and support ✌
Absolutely wonderful explanation of MergeSort!
I was amazed at how in-depth you went in your video and I know recording this took a *lot* of time! Bravo, well done! I'm using this for my Java class, but if all of your videos are this in-depth, I may start learning C++ just to support your work. It is rare to see a teacher willing to put so much effort into their craft.
Thank you so much for your wonderfull feedback. Yes this video took a lot of time and effort to make but it seems like it turned out very well! And your positive comments and feedback really make me feel it was all worth it! :)
really appreciate your way of teaching,
hats off
Thank you very much for explaining this way! I appreciate you walking through the algorithm it very helped me to understand it at a fundamental level. Not enough quality content like this that i've found. I'm going to try it by hand myself now :)
Thank you so much sir for this helpful video. now I could clear my concept of merge sort which was very confused for me.
Thanks a lot again.
Love you man, this video helped me in understanding merge with recusion. 💯% satisfied and 💯% recommended
no one can explain it better than explained by you.these videos are quite amazing.....best channel
Thank you so much 😀
I had a hard time understanding this concept for quite a while. But this video alone cleared them all and I think this 53 minte session was totally worth it .thanks for such awesome explanation and the hard work. Peace ☮️
Thanku❤🙏🙏🌹for this how the mergesort will work I can try to understand these recursive call how work and spend 2days but after I saw a video on that particular concept that we can try to understand but we can't find but still there so thanku bro for this great 👏👍👍😊explanation