Learn Merge Sort in 13 minutes 🔪

Ғылым және технология

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: KZread Au...
===========================================================

Пікірлер: 233

  • @BroCodez
    @BroCodez3 жыл бұрын

    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 System.out.print(array[i]+ " "); } } private static void mergeSort(int[] array) { int length = array.length; if (length

  • @syllight9053

    @syllight9053

    3 жыл бұрын

    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!

  • @BroCodez

    @BroCodez

    3 жыл бұрын

    @@syllight9053 Thank you Syllight!

  • @immortalbotyt1428

    @immortalbotyt1428

    3 жыл бұрын

    I already did my big bro :D If we both belonged to only 1 family u would be my bigger bro :D

  • @aditya_asundi

    @aditya_asundi

    3 жыл бұрын

    3 weeks making this *AND THERE'S A DISLIKE????*

  • @roysaka4475

    @roysaka4475

    3 жыл бұрын

    Hi bro plsae reques Tutorial Python AndroidHelper. Music, recorder, voice mix, microfon. Call phone, game, calculator, google voice recorder, and others.. 🙏🙏🙏🙏🙏🙏 Plsee

  • @mayawhocodes3092
    @mayawhocodes30922 жыл бұрын

    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.

  • @sancho608

    @sancho608

    Жыл бұрын

    No. You are a bro now!!

  • @fsxanas90

    @fsxanas90

    2 ай бұрын

    why the karen vibe tho lmao

  • @johndavis29209

    @johndavis29209

    Ай бұрын

    @@fsxanas90 Why anything

  • @user-kn4oi9oh4i

    @user-kn4oi9oh4i

    5 күн бұрын

    You are a bro! 👊

  • @coltonbailey8873
    @coltonbailey88733 жыл бұрын

    You are single-handedly teaching me programming/computer science. Thank you. Never change your teaching structure, because this method works really well.

  • @Jathamus
    @Jathamus2 жыл бұрын

    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 !

  • @kingipra
    @kingipra Жыл бұрын

    Best explanation I've seen so far. The rundown at the beginning really helps. Thank you

  • @smokinginthefishroom
    @smokinginthefishroom Жыл бұрын

    The best merge sort explanation on KZread. Watched like 5 other videos but only this explained how the merge part of merge sort actually works! Liked and subscribed.

  • @jorgemedina8497
    @jorgemedina8497Ай бұрын

    This is the best video I found on all youtube which explains Merge Sort properly. This video is the definition of Quality Content.

  • @nyasha_keith_matevengwe
    @nyasha_keith_matevengwe2 жыл бұрын

    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

  • @nyankiku5863
    @nyankiku5863 Жыл бұрын

    You made mergeSort look so simple and easy, thank you so much!

  • @raywei1701
    @raywei17019 ай бұрын

    So clear. my professor did not have enough time to go over this in class. Now I understand everything about merge sort.

  • @murnoth
    @murnoth Жыл бұрын

    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

  • @paulodasilvasa9884
    @paulodasilvasa98848 ай бұрын

    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!!!

  • @lingjosh6801
    @lingjosh68013 жыл бұрын

    Clearly explanation and demonstration with merge sort, great work!!! Can,t wait for more CS videos.

  • @GamerOverThere
    @GamerOverThere10 ай бұрын

    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

  • @danielebbersmeyer5087
    @danielebbersmeyer50874 ай бұрын

    Probably the best video i've seen so far to explain Mergesort, i think i finally got it!

  • @NH-ij8dz
    @NH-ij8dz4 ай бұрын

    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.

  • @aadv1k
    @aadv1k5 ай бұрын

    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!

  • @charalamposkatsoukis8694
    @charalamposkatsoukis8694 Жыл бұрын

    top content as always. No one more understandable than Bro! (I hope you doin good on your break!!!)

  • @user-hi8qt6rq4b
    @user-hi8qt6rq4b Жыл бұрын

    Good job! It is really easy to understand the algorithm with this video, thank you

  • @eniax
    @eniax Жыл бұрын

    Best merge sort tutorial I've seen, thank you

  • @sanskarsongara2592
    @sanskarsongara25923 жыл бұрын

    Idk you sounds more confident in recent new videos, keep going homie you still gotta reach more people👍

  • @docjp7427
    @docjp74277 ай бұрын

    You are the best Bro I never had. 2 years have gone by, but this is still amazing.

  • @bhumikajoshi6966
    @bhumikajoshi69663 жыл бұрын

    it'd be really helpful if you continue this playlist!!! thanks in advance

  • @tipster360
    @tipster360 Жыл бұрын

    The best merge sort explanation! Thank you so much.

  • @doogiehowser1124
    @doogiehowser11249 ай бұрын

    Wow! this is a good tutorial. Thank you very much for taking the time to put it together! Well Done!

  • @nurulafsar3195
    @nurulafsar3195 Жыл бұрын

    Best explanation of merge sort so far!

  • @DruzeJosipTito
    @DruzeJosipTito Жыл бұрын

    You just made my computer science assignment a whole lot easier lol. Thank you.

  • @rizzbod
    @rizzbod Жыл бұрын

    Thanks man! , because of you , i can skip the tough work of learning, hehe, and straight jump into implementing algorithms

  • @mohtasimbillah6560
    @mohtasimbillah65602 жыл бұрын

    Really good explanation of merge sort! It helped heaps!

  • @quantjet7718
    @quantjet77186 ай бұрын

    Wow you are one of the best KZreadrs to explain algorithms

  • @cadmium4113
    @cadmium41133 жыл бұрын

    Started your Java playlist love your tricks to teach... Appreciate from another fellow BRO.

  • @sprinklepancake
    @sprinklepancake Жыл бұрын

    Thank you!! this was very thorough and clear!!

  • @vansh9857
    @vansh9857 Жыл бұрын

    You earned a sub! Awesome explanation

  • @toxiclucien8168
    @toxiclucien81682 жыл бұрын

    very helpful video...watching all your sorting videos and learning from it...thanks BRO

  • @zyad6385
    @zyad63857 ай бұрын

    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

  • @Snowmanver2
    @Snowmanver22 жыл бұрын

    a concise and helpful tutorial, thanks Bro!

  • @JazzInATinCan
    @JazzInATinCan Жыл бұрын

    Good video, not too long, not too short. Great job.

  • @hannibalbianchi1466
    @hannibalbianchi14663 жыл бұрын

    No words can explain my appreciation Thank you, sir 🏆🏆🏆🏆

  • @quantumtea7394
    @quantumtea73943 жыл бұрын

    Thank you for your amazing videos!!!❤️❤️❤️

  • @aorusaki
    @aorusaki9 ай бұрын

    Needed this for my interview :))) thank you!

  • @MrWardo2009
    @MrWardo20099 ай бұрын

    Thank you so much for making this video!

  • @arturofuentes2230
    @arturofuentes22303 ай бұрын

    Great video man, I understood everything so quickly, thank you so much and keep coding bro

  • @Crystal-gs4gu
    @Crystal-gs4gu Жыл бұрын

    Thank you for saving me from my final test. You are the best teacher

  • @AntiPedophile
    @AntiPedophile Жыл бұрын

    thanks for these videos ,we need them alot

  • @engineeringmania9125
    @engineeringmania9125 Жыл бұрын

    Thanks man!!! Great video🤗

  • @ashutoshswain4050
    @ashutoshswain40502 жыл бұрын

    thanks a lot bro this solution and your explanation is awesome:)

  • @solonton6341
    @solonton63412 жыл бұрын

    great work, well explained!

  • @neophilosophy1764
    @neophilosophy17643 ай бұрын

    Nice. Thanks for the video!

  • @09FT9
    @09FT92 жыл бұрын

    If you ever publish a book, I'd be the first one to buy it. Excellent work, Bro. 🙏

  • @jamongx1
    @jamongx1 Жыл бұрын

    Thanks for your explain! it's very helpful to understand!

  • @EzraSchroeder
    @EzraSchroeder Жыл бұрын

    WoW! Gorgeous video! Mergesort can be hard to understand. Great, great job!

  • @Bromon655
    @Bromon6554 ай бұрын

    Recursive algorithms are the bane of my existence.

  • @DJSaez-ll8or
    @DJSaez-ll8or2 ай бұрын

    Really helpful video, thank you!

  • @brandonkruger9040
    @brandonkruger90403 жыл бұрын

    Thanks for another great video bro.

  • @ernestselman3955
    @ernestselman39557 ай бұрын

    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?

  • @radicalsaled5756
    @radicalsaled5756 Жыл бұрын

    nice job, simple explanation of a long algorithm

  • @mike-fl9xi
    @mike-fl9xi Жыл бұрын

    gg bro. super helpful, nice break down

  • @juanivillanueva7873
    @juanivillanueva7873 Жыл бұрын

    You are a better teacher than my dsa ones!

  • @AN-rz7bs
    @AN-rz7bs8 ай бұрын

    Thanks, this video really helped me!

  • @andrewchen861
    @andrewchen861 Жыл бұрын

    Great video! Now I understand it :)

  • @hoanganhnguyen3438
    @hoanganhnguyen34384 ай бұрын

    omg, I love the music. Good stuffs brah =)))))))))))))

  • @sallaklamhayyen9876
    @sallaklamhayyen98763 ай бұрын

    great job = thank you so much please continue🥰

  • @greenachos372
    @greenachos3723 жыл бұрын

    Thanks for the informative video

  • @kennysoyoye493
    @kennysoyoye4936 күн бұрын

    this really helped me understand merge sort. thanksss a lot

  • @Matthew_080
    @Matthew_0806 ай бұрын

    Thanks for explaining merge sort!

  • @scottzeta3067
    @scottzeta30672 жыл бұрын

    Thanks Bro, you are the best!

  • @bryanswiger5888
    @bryanswiger5888 Жыл бұрын

    Like button smashed..... thanks bro

  • @MikeSieko17
    @MikeSieko176 ай бұрын

    yo bro thanks bro, great stuff bro from one bro to another bro

  • @ianvensonbolanio3327
    @ianvensonbolanio3327 Жыл бұрын

    Thankyouuuuusomuch, your video really helps our group "MEMANG".

  • @sanjusaju4049
    @sanjusaju4049 Жыл бұрын

    The best video ever .....love u man....

  • @esmailalmoshki
    @esmailalmoshki Жыл бұрын

    شغل جامد يسطى

  • @vinayshenoy9896
    @vinayshenoy9896Ай бұрын

    very well explained, Thank you very much

  • @wmd5645
    @wmd56452 жыл бұрын

    nice. very nice. If you didnt work as a sw engineer, my professors were really as bad as i knew they were. good job.

  • @josy7
    @josy77 ай бұрын

    Thanks for the content !

  • @valioprea9796
    @valioprea9796 Жыл бұрын

    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 ?

  • @MeditateRelaxEtcetera
    @MeditateRelaxEtcetera4 ай бұрын

    That's terrific! I'm working my way thru your videos. Wish I found your channel earlier.

  • @sahu_SuMiT
    @sahu_SuMiT3 ай бұрын

    awesome, as always....

  • @alaasefa1118
    @alaasefa1118 Жыл бұрын

    this the most helpful channel thank u a lot🥰🥰

  • @BrunoHenrique-oe5hb
    @BrunoHenrique-oe5hb2 күн бұрын

    Bro, youre helping me through college. I appreciate it

  • @Ray101SPAS
    @Ray101SPAS Жыл бұрын

    Nice explanation. Now it does not seem so complicated.

  • @johnxina7496
    @johnxina74965 ай бұрын

    amazingly explained

  • @nitinsoni9956
    @nitinsoni99563 жыл бұрын

    Hey bro thanks for the video.

  • @danilohonda3078
    @danilohonda30788 ай бұрын

    thanks for the class!!!!

  • @leoniaklebanov2502
    @leoniaklebanov25022 жыл бұрын

    Awesome and simple

  • @Assassin274
    @Assassin27414 күн бұрын

    This was amazing and simple

  • @jaredshaw2967
    @jaredshaw2967 Жыл бұрын

    awesome explanation bro

  • @childishpumpino6751
    @childishpumpino675111 ай бұрын

    Thank you brother!!!

  • @smikkelbeer7890
    @smikkelbeer7890 Жыл бұрын

    Thanks. I tried my own implementation but for some reason it didn't work so I just followed along with yours.

  • @rabiizahir2885
    @rabiizahir2885 Жыл бұрын

    Great video. Thanks

  • @nasirbashirov
    @nasirbashirov3 жыл бұрын

    Bro king👑

  • @fernandofigueroa5332
    @fernandofigueroa53323 жыл бұрын

    thanks for the video :)

  • @ironmonkey1990
    @ironmonkey1990Ай бұрын

    Thank you !

  • @Yuschova
    @Yuschova9 ай бұрын

    this 13 mins vid is way better than 5hrs+ lectures xD

  • @one111won
    @one111won Жыл бұрын

    legendary explanation

  • @lazi21
    @lazi21 Жыл бұрын

    how do you deal with an uneven number of elements in an array when using mergesort?

  • @dangerbirb4981
    @dangerbirb49812 ай бұрын

    I like your taste in music :D

  • @lokszeto6627
    @lokszeto6627 Жыл бұрын

    amazing!

  • Жыл бұрын

    Does it only work for arrays with its size being an integer power of 2

  • @stupark4152
    @stupark4152 Жыл бұрын

    Nice explanation

  • @KaviKhattri
    @KaviKhattri3 жыл бұрын

    Big fan bro

Келесі