Learn Merge Sort in 13 minutes 🔪
ฝัง
- เผยแพร่เมื่อ 11 ก.ค. 2021
- Merge sort algorithm tutorial example explained
#merge #sort #algorithm
// merge sort = recursively divide array in 2, sort, re-combine
// run-time complexity = O(n Log n)
// space complexity = O(n)
music credits 🎼:
===========================================================
Title: Wallflowers
Artist: Bad Snacks
Link: • bad snacks: TH-cam Au...
=========================================================== - วิทยาศาสตร์และเทคโนโลยี
This video took me THREE WEEKS to produce! Ya'll better smash that like button for me! lol
public class Main{
public static void main(String args[])
{
// merge sort = recursively divide array in 2, sort, re-combine
// run-time complexity = O(n Log n)
// space complexity = O(n)
int[] array = {8, 2, 5, 3, 4, 7, 6, 1};
mergeSort(array);
for(int i = 0; i < array.length; i++){
System.out.print(array[i]+ " ");
}
}
private static void mergeSort(int[] array) {
int length = array.length;
if (length
Don't worry bro, I smashed the like button, plus I contacted the president to set a direct nuclear launch to the like and subscribe button as well!
@@syllight9053 Thank you Syllight!
I already did my big bro :D If we both belonged to only 1 family u would be my bigger bro :D
3 weeks making this *AND THERE'S A DISLIKE????*
Hi bro plsae reques Tutorial Python AndroidHelper. Music, recorder, voice mix, microfon. Call phone, game, calculator, google voice recorder, and others..
🙏🙏🙏🙏🙏🙏 Plsee
The way you broke this down into simple terms with visuals and everything, amazing. I'm not a bro, but I do code. And this was lit. Thank you.
No. You are a bro now!!
Best explanation I've seen so far. The rundown at the beginning really helps. Thank you
You are single-handedly teaching me programming/computer science. Thank you. Never change your teaching structure, because this method works really well.
I knew when I saw "Bro Code" it would be a beautifully simple video.
What you did that the other videos I watched failed to do was walk through the sort / merge in the order that it would actually happen.
The other videos were doing it by rows and not the actual order that it happens in. Thank you ! That is what made it click for me.
I am now subscribed !
The best merge sort explanation on TH-cam. Watched like 5 other videos but only this explained how the merge part of merge sort actually works! Liked and subscribed.
You made mergeSort look so simple and easy, thank you so much!
You are a great tutor sir, I appreciate, I was failing to understand this all along, but just because of your video, I feel confident enough
Thank you man!!! Finally I have found the best explanation of merge sort! You really helped us a lot.
I've alredy smashed the like button, you deserve it bro!!!
Trying to make these algorithms with blueprint nodes in UE5, and following along with your code is also helping me translate code jargon into blueprint equivalents. Thank you for sharing
Bro, you are a legend. My professor went over merge sort for 1 1/2, and I was left confused. I watched a Harvard lecture video on it, still confused. Asked chatGPT about individual components (not to cheat but to have it explain each step to me, I want to understand this) and it was spewing nonsense. But your video made it finally click. Thanks bro! Liked and subscribed
So clear. my professor did not have enough time to go over this in class. Now I understand everything about merge sort.
Clearly explanation and demonstration with merge sort, great work!!!
Can,t wait for more CS videos.
Best merge sort tutorial I've seen, thank you
it'd be really helpful if you continue this playlist!!!
thanks in advance
Idk you sounds more confident in recent new videos, keep going homie you still gotta reach more people👍
The best merge sort explanation! Thank you so much.
Probably the best video i've seen so far to explain Mergesort, i think i finally got it!
top content as always. No one more understandable than Bro! (I hope you doin good on your break!!!)
Thank you for the beautifully elegant explanation that didn't require the viewer to have a PhD. You are one talented bro. Keep it up!
Needed this for my interview :))) thank you!
Started your Java playlist love your tricks to teach... Appreciate from another fellow BRO.
Great video. I needed to implement this in C for a CS class and this video explained it in much clearer and easier to follow way than the so called experts who are being paid 6 figures a year to teach this to me. Ty bro.
Good job! It is really easy to understand the algorithm with this video, thank you
Wow! this is a good tutorial. Thank you very much for taking the time to put it together! Well Done!
You are the best Bro I never had. 2 years have gone by, but this is still amazing.
Great video man, I understood everything so quickly, thank you so much and keep coding bro
Best explanation of merge sort so far!
You just made my computer science assignment a whole lot easier lol. Thank you.
a concise and helpful tutorial, thanks Bro!
Wow you are one of the best TH-camrs to explain algorithms
Really good explanation of merge sort! It helped heaps!
very helpful video...watching all your sorting videos and learning from it...thanks BRO
Thanks man! , because of you , i can skip the tough work of learning, hehe, and straight jump into implementing algorithms
Thank you!! this was very thorough and clear!!
You earned a sub! Awesome explanation
Recursive algorithms are the bane of my existence.
No words can explain my appreciation
Thank you, sir 🏆🏆🏆🏆
After 2 years this is still very useful i understand everything now .
even though i don't know how to use java i've just learned c++ but everything is clear now
Good video, not too long, not too short. Great job.
Thank you so much for making this video!
Thanks man!!! Great video🤗
Thank you for saving me from my final test. You are the best teacher
great job = thank you so much
please continue🥰
Thanks for your explain! it's very helpful to understand!
thanks for these videos ,we need them alot
thanks a lot bro this solution and your explanation is awesome:)
WoW! Gorgeous video! Mergesort can be hard to understand. Great, great job!
Really helpful video, thank you!
Thank you for your amazing videos!!!❤️❤️❤️
Thanks for another great video bro.
Thanks for the informative video
Thank you brother!!!
Nice. Thanks for the video!
great work, well explained!
First of all I just wanted to let you know that thanks to your java section I landed a job as a java developer.
So ...from the bottom of my heart, thank you, keep up the good work!
On the other hand, a question for this video: what if the array has an odd length ?
If you ever publish a book, I'd be the first one to buy it. Excellent work, Bro. 🙏
yo bro thanks bro, great stuff bro from one bro to another bro
Thanks for the content !
omg, I love the music. Good stuffs brah =)))))))))))))
Hey Bro Code, thanks for the video. It really helped me learn MergeSort. I have a question. In your implementation, would the memory requirements be nlog(n) or n? Since you are creating copies of the arrays as you go down recursively, that would be adding to the memory. If I make the mergeSort method by passing a reference of the original array and indexes representing the start and end of left and right subarrays, then only create the required copies in the merge method before backtracking, wouldn't the maximum memory used be the last step where we would have copies of the entire original array and therefore memory utilization would be 2n or just n?
Thankyouuuuusomuch, your video really helps our group "MEMANG".
That's terrific! I'm working my way thru your videos. Wish I found your channel earlier.
gg bro. super helpful, nice break down
Like button smashed..... thanks bro
Thanks, this video really helped me!
thanks for the class!!!!
The best video ever .....love u man....
Thanks Bro, you are the best!
Thanks for explaining merge sort!
nice job, simple explanation of a long algorithm
u are the best ,bro!
this the most helpful channel thank u a lot🥰🥰
amazingly explained
awesome, as always....
You are a better teacher than my dsa ones!
nice vid bro
Great video! Now I understand it :)
شغل جامد يسطى
legendary explanation
awesome explanation bro
Hey bro thanks for the video.
Thank you bro💓
Awesome and simple
nice. very nice. If you didnt work as a sw engineer, my professors were really as bad as i knew they were. good job.
Nice explanation
amazing!
Thank you
Nice explanation. Now it does not seem so complicated.
Bro king👑
Amazing 👏
thanks for the video :)
Great video. Thanks
thank you, sir
Thanks. I tried my own implementation but for some reason it didn't work so I just followed along with yours.
Big fan bro
Nice class
Thanks!
i love you brocode 😻
thanks bro 🙏