Có phải là bạn đang muốn tìm kiếm nội dung nói về merge sort có phải không? Phải chăng bạn đang muốn tìm chủ đề Algorithms: Merge Sort đúng không? Nếu đúng như vậy thì mời bạn xem nó ngay tại đây.
NỘI DUNG BÀI VIẾT
Algorithms: Merge Sort | Xem thông tin về laptop tại đây.
[button color=”primary” size=”medium” link=”#” icon=”” target=”false” nofollow=”false”]XEM VIDEO BÊN DƯỚI[/button]
Ngoài xem những thông tin về laptop mới cập nhật này bạn có thể xem thêm nhiều nội dung hữu dụng khác do soyncanvas.vn cung cấp tại đây nha.
Kiến thức liên quan đến chuyên mục merge sort.
Tìm hiểu những điều cơ bản về sắp xếp hợp nhất. Video này là một phần của Hướng dẫn Phỏng vấn Cracking The Coding của HackerRank với Gayle Laakmann McDowell.
Hình ảnh liên quan đếnchủ đề Algorithms: Merge Sort.
>> Ngoài xem đề tài này bạn có thể xem thêm nhiều Kiến thức hay khác tại đây: Xem thêm nhiều kiến thức mới tại đây.
Nội dung liên quan đến đề tài merge sort.
#Algorithms #Merge #Sort.
[vid_tags].Algorithms: Merge Sort.
merge sort.
Mong rằng những Kiến thức về chủ đề merge sort này sẽ có ích cho bạn. Cảm ơn bạn rất nhiều.
Very helpful, thank you so much for this video.
Every single coding tutorial ever has 10x as many words as needed. Reeeeeeee
We are all now dumber for having listened to your explanation. Seriously though… how can you be so inept at explaining something so simple.
For some reason, most of the algorithmic videos from HackerRank team are more confusing than helpful.
This easily falls among the worst explanations of merge sort I've seen to date.
This was terrible. I don't get the part with the if (leftStart >= rightEnd), what does that mean?
this code has a flaw. on the 44th line change size to size + 1
honey your books are amazing but your verbal explanation is exactly the opposite
Applying this to an algorithm I’m wanting to make
Too bad! Terrible!
this is exactly how every teacher or professor teaches at our garbage overpriced education when my cousin or friend can sit down and teach this shit in 10 minutes all together
Man Gayle's algo tutorials are so bad it just confuses the heck out of me even more.
if you do (left+right)/2 it may potentially cause overflow, which will be a negative point in the real interview. The correct way is left + (right – left)/2. boo….
ive watched other videos and this is problem the worst explanation of the bunch lol
I like this clean code! Simple and easy to understand.
Ok now imma remove my sub and replace my like with a dislike
public int[] mergeSort(int[] arr) {
return mergeSort(arr1, arr.lenght);
}
private int[] mergeSort(int arr[], int len) {
if(len == 1) return new int[] {arr[0]};
int midIndex = len/2;
int arr1[] = new int[midIndex];
int arr2[] = new int[arr.length-midIndex];
int i=0, j=0;
while(i<arr1.length)
arr1[i] = arr[i++];
while(j<arr2.length)
arr2[j++] = arr[i++];
arr1 = mergeSort(arr1, arr1.length);
arr2 = mergeSort(arr2, arr2.length);
return merge(arr1, arr2);
}
private int[] merge(int arr1[], int arr2[]) {
int res[] = new int[arr1.length+arr2.length];
int i=0, j=0, k=0;
while(i<arr1.length && j<arr2.length)
if(arr1[i] < arr2[j])
res[k++] = arr1[i++];
else
res[k++] = arr2[j++];
while(i<arr1.length)
res[k++] = arr1[i++];
while(j<arr2.length)
res[k++] = arr2[j++];
return res;
}
Timsort: Hold my beer
1:35 protest for dark IDE
I have to say I owe you an apology Gayle. I resented you for what the hiring industry has become, due to the HackerRank association… As if you started the ranking of developers in one completely odd discipline thus barring the door for us older cats who don't remember this stuff from college lol…I just kept thinking "Why should we waste so much time memorizing this crap? Isn't it enough to know they exist if we need them for a solution?"
Well I was wrong…just in the last couple of weeks I dove headfirst down the rabbit hole(as is my thing) this time with Algorithms and a whole new world just smacked me in the face.
I still resent the hiring practice. HackerRank should be about competitive programming not people's livelihoods, that being said, EVERY developer should learn and code up the foundational algorithms, learn time complexity and the by-product of these algorithms we call data structures. I knew about the main ones and what they did, thinking that was enough…10 years a developer without a rich study of this stuff…why??? I could have been great:(… lol j/k can still be! Sorry Gayle and thank you
This is not the obvious way to explain or code the merge sort, a lot of extra stuff for nothing 🙁
Chutiya hai kya
I'm here after Leetcode gave us a a problem to sort a linked list in ascending order
There is a saying that you only truly understand something if you can explain it to someone else. This woman just memorized the code. She understands nothing and can’t explain shit.
this is trash
I'm surprised about the quantity of comments complaining about the video. It is great!
I am not experienced enough to understand this. All i came here was for the first 20 seconds of the video
you should use a picture while coding
Thank you!
This was great! Thought I'd add a note that helped me understand the algorithm better. This is a recursion problem, and in the video, we end the recursion when the "left end" is greater than the "right start." That's all well and good, but at a conceptual level, it's still a little unclear what the base case of the recursion is. To answer this question, consider that just before the "left end" is greater than the "right start" (i.e. in the second to last recursion), we are calling mergesort on a single-element array. But a single-element array is, by definition, already sorted! So basically we recurse until the solution is trivial ("this array is already sorted because it only has one element"), and then we start to combine all of our single-element arrays back into a larger, still-sorted array using mergeHalves.
first time disappointed with your videos
If you are a newbie to mergesort please come later – learn its basics and practice first. If you still couldnt get the code working after many hours of practice, come and watch this video. Its beautifully explained. Only after watching this, i can turn my pseudo code into working code. Thanks Gayle!
idk what you guys are complaining about, this wasn't that hard to follow.
I thought I was alone not understanding the steps.
Question: How is it that you "run the code" and it gives the output of a sorted array? you have no return values anywhere…? Im either blind or missing something here. The temp array needs to be returned somehow, but Im just not seeing it here.
Thankyou so much !!
You explained with such a simplicity….❤️
The only thing she's done different from the typical code for merge sort you'll find online is: she's used a temp array rather than removing elements from the two partitioned array and at the end checking which one's empty
ekdum Fuddu code
Worst MS explanation on YT, beware
I think it's better to read the book and other sources first and then watch this video…I also advise watching it at 0.75 since she speaks really fast
I don't agree with rest of the comments. The way she names her variables are amazing… I have been trying to understand mergesort for hours and this finally allowed me to get it!
lovely!
Very nice! This made me clearer.
oh god, this mess my mind up so bad…….
array.sort()
Why Java is so scary?
What IDE u use??