How to Code The Merge Sort Algorithm in Java

preview_player
Показать описание
How to code the merge sort algorithm in Java 8. Merge sort is a sorting algorithm that splits an array into halves until each half has a single element. It then merges the split arrays, returns the merge, and continues up the recursive ladder until the whole sorted array is returned.

---

Рекомендации по теме
Комментарии
Автор

Best step by step explanation of merge sort code in YouTube

aishikbhattacharya
Автор

initialization for right array can be resolved by taking , int right[] = new int[array.length-mid]; Otherwise really a good explanation of code.

divyamehta
Автор

This explanation is simpler and better than GeeksforGeeks, tbh.

xingjianwang
Автор

This is the beauty of bottom-up approach. This tutorial is so easy to understand because Johnathon did a bottom-up approach. Hands down, the best tutorial on merge sort in Java on YT. This video should have had 1 million likes.

iamarnabpal
Автор

2:46 this is ONE EXAMPLE of what made your tutorial different and exponentially better than other tutorials.

You stopped and asked “what if” then proceeded to answer that “what if” immediately. Other tutorials just starts with an array of size 8, explains merge sort as “DiViDe aNd cOnqUeR” then call it a day.

So, I’d like to say thank you for making this great tutorial.

markd
Автор

Although I don't take paid courses online, I seriously think you should make one. You have a natural talent at explaining code. Seriously, it's the best explanation on YouTube, ever!

saikiranj
Автор

I cannot even begin to say how much this helped

DR-ngoh
Автор

Unbelievable Tutorial, i tried so many courses and watched so many videos and still couldn't understand Merge Sort, because the instructor didn't explain the code well or just show the code without saying a single word. Thank you so much!

javaexpertsa
Автор

just came across this, amazing video, I do have one comment and it just simplifies the code much more. my comment is that if the array of size 7 -> mid point is 7/2 = 3 you initialize that first array with size 3 and then you initialize the right array with, (consider array is the main original array name), array.length - midpoint size and that is 4 so that way you don't really need all those if else statements. it works if the array was of size 8 too (even split). other than that greatttt work and very good vid

iyadshaheen
Автор

One of the best video in youtube for merge sort.. 👍👍👍👍👍 easy to understand and remember...

greentorainchannel
Автор

The way of teaching is excellent johnathon tq.

rachamallidorasrivignesh
Автор

The best explanation of Java Code for Merge Sort on You tube

yolopassion
Автор

This is so much simpler to understand and easy to remember, Thank you! However, I think you must correct your IF condition at line 71 to if(left[leftPointer] <= right[rightPointer] to make this a stable sort. Correct me if i am wrong.

mongogoose
Автор

Thankyou so much, this explanation is literally so much better than what was in my textbook lol

bm
Автор

This is such a great explanation. Had been struggling to understand the concept and code accordingly and this implementation & explanation is too good. Thanks again!

DeepsWar
Автор

Finally, someone, with full control over what he does, explaining it... A BIG THANKS LIKE AND SUB!

cenkercanbulut
Автор

Gotta say, I like your solution the best. Clear explanation too, thanks alot.

Vaelon
Автор

best explanation you could found on youtube

nguyenphuc
Автор

your explanation helped me a lot
keep doing more videos on ds and algo

pradyumna
Автор

Omg thank you so much this is the best explanation I found on YouTube

filiptomic
welcome to shbcf.ru