@timoteisatmarean7391

This is the type of explanation I was looking for while trying to learn merge sort!

@iLieOfficial

Damn, this is the first time I'm watching a merge sort tutorial that doesn't make my mind go crazy but makes everything crystal clear! would love to go through all your DSA courses.

@reda-w4g

I don't even look at what I need on YT anymore, I just go straight to your channel. Here's the crazy part, I'm using this to actually learn problem-solving in JS. But, I have some background in C++, so I can follow along just fine. Thank you so much! Also, please make videos on more advanced algorithms like BFS, DFS, Dijkstra's, Dynamic Programming, etc. You can turn that into Udemy courses even. Would buy it in a heartbeat.

@isaacoach6041

For sure, I've never met such explaination since I started learning to code. Every single letter is explained... There's nothing to be said, this is just awsome!

@dennisfolz352

5:28 omg I confounded r-l with r-1 and that's why the program always resultet in an infininite loop. I also didn't get "why is it r-1 ??" This little mistake forced me to debug for hours. But now I understand every little detail of merge sort. Thanks for the video :)

@dvmvge5766

First free video which actually explains this algorithm well 😃

@wojciechszpara2686

Easy to find, easy to listen easy to understand. Thank you.

@1CProgrammer

i had to watch this this video almost 6 time to install concept into my brain, thankyou for amazing video's.

@shanewalsch

hmmm... visual studio compiler doesn't let to create static arrays with variables. That's strange

@mysticaesir

Perfect! This helped immensely. Thank you! Only took about six hours.

@voidronin068

it all makes sense now, i feel enlightened.

@mahmoudsalah2231

How can it be true to say temp_left[left_length]?? i think size of the array can't be vaiable

@ramrodriguez2068

A very helpful explanation thank you very much! Really appreciate the actual process explanation through the comments.

@karimdhrif6679

This has been a huge help for me!

@mokochan4129

Thank you so much for this video, now I understand this algorithm better.

In 10:34 you mention, that both of the subarrays have been sorted, however i dont quite understand when the sorting really happend. For me it seems like the only time the array is starting to get sorted, is when both subarrays get merged in 13:41. Thats where you compare the values of each index. But like when does the sortting start within the subarrays?

I also have another question regarding the function merge_sort_recursion in 07:03 How will the compiler come to the line merge_sorted_arrays(a, l, m, r);? After r gets smaller due to the recursion, eventually r=0, the condition l<r is not fullfilled anymore right? Which means that everything that happens within that if-block, will not happen anymore right? Thus we will never reach the line merge_sorted_arrays(a, l, m, r);?

@Marianojoey

Awesome explanation and great example. Thank you very much. :D

@duytruong3956

Hi, I wonder if in function merge_sort_recursion, the condition must be l < r? As my understanding, when the array is divided into sub-arrays with 1 element, you get l = r, there is no scenario such that l > r. So should the condition in merge_sort_recursion be just l == r? Please correct me if I'm wrong.

@qneqne8440

So it's taken a few days and attempts to wrap my head around the implementation of this algorithm. The only part I'm now confused on is: At merge_sort_recursion but before merge_sorted_arrays, you claim that the sub-arrays are sorted. How??? We only divided arrays into smaller and smaller arrays but never sorted them

Edit: Like lines 66 and 67 in your Github code, you claim "at this point both portions of the array have been sorted, and we now  merge the sorted portions of the array" I don't see a code preceding this line that "sorts" the array. Only divides it into smaller and smaller parts

@chubskuy8254

this is the easiest merge sort code 🤯🤯🤯