Phải chăng bạn đang muốn tìm kiếm nội dung về quick sort có phải không? Hình như bạn đang muốn tìm chủ đề Quicksort đú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
Quicksort | 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 có ích khác do Chúng tôi cung cấp tại đây nha.
Kiến thức liên quan đến từ khoá quick sort.
Video này là một phần của khóa học Udacity “Phỏng vấn kỹ thuật”. Xem toàn bộ khóa học tại
Hình ảnh liên quan đếnđề tài Quicksort.
>> Ngoài xem chuyên mục này bạn có thể tìm hiểu thêm nhiều Thông tin hay khác tại đây: Xem thêm tại đây.
Nội dung có liên quan đến chủ đề quick sort.
#Quicksort.
[vid_tags].Quicksort.
quick sort.
Chúng tôi mong rằng những Thông tin về chủ đề quick sort này sẽ hữu ích cho bạn. Cảm ơn bạn rất nhiều.
And how do we define the function and conditions for the last swap? To be honest, you have actually divided the array in two parts and sorted and then again extracted another subpart from the array into a another temp array and made a pivot, for which the condition is variable. But the main algo for quick sort is (devide array into two parts such that part I is smaller than the pivot and part II is bigger than pivot, sort the left part, sort the right part, and done). This video has followed the algo to some extent but it is not entirely correct.
basically, choose a pivot then put values > pivot to right else to left then bubble sort each side.
Zvikukwidibira
2:52 Correction: *10 is bigger than the pivot (8 is the pivot)
I think this is the best algorithmic approach to Quicksort. Also, I would supplement this explanation with this one: https://www.youtube.com/watch?v=COk73cpQbFQ
Best explanation ever !
what is this swapping thing, that's not quicksort
i watched tons of video regarding quick sort but so far this is the best and easiest one…
Median-of-Three Partitioning
The median of a group of N numbers is the ⌈N/2⌉ th largest number. The best choice of pivot would be the median of the array. Unfortunately, this is hard to calculate and would slow down quicksort considerably. A good estimate can be obtained by picking three elements randomly and using the median of these three as the pivot. The randomness turns out not to help much, so the common course is to use as the pivot the median of the left, right, and center elements. For instance, with input 8, 1, 4, 9, 6, 3, 5, 2, 7, 0 as before, the left element is 8, the right element is 0, and the center (in position ⌊(left + right)/2⌋) element is 6. Thus, the pivot would be v = 6. Using median-of-three partitioning clearly eliminates the bad case for sorted input (the partitions become equal in this case) and actually reduces the number of comparisons by 14 percent.
This doesn't explain it programmatically. It makes no sense from a person trying to actually write code to implement it.
That was a great explanation.
Inspired by your content I created a video with some animations and visuals. Quick Sort can be fun 😀
Check it out here https://youtu.be/2SRzQEOaLYw
your explanation is amazing, good job and thank you!
Not a good explanation…. This is good: https://www.youtube.com/watch?v=7h1s2SojIRw
But i wish you can also offer the implementation of it in python. Thanks!
I must give a big thumb to this YouTuber. This video is most understandable i have ever seen.
I was watching a video on LinkedIn Learning and the instructor had over 30 years experience in software development and could not do a better job than this 4 minute illustration, omg….this is beautifully explained and very easy to understand. i have a degree in math and statistics so numbers are my thing but that guy dint do a good job like you.
Thank you from all ukrainian CS students!
At 2:18 is it just a coincidence that 0 and 1 are ordered correctly, or is it always the case that the elements to the left of the pivot will be strictly ordered?
The best! Logic way and intuitive way! No memorization much at all!
If you tend to move all elements left side then it takes lot of time so only the adjacent left you move to first…
I did watch some other lectures also… Until you get it keep on watching. Think for yourself also…
this is a very inefficient way of doing it, you are swapping two numbers each time, you can and should do this with much less swaps..
2:52 – small correction – "10* is bigger than the pivot"
def quicksort(arr):
if len(arr) <= 1:
return arr
else:
return quicksort([x for x in arr[1:] if x<arr[0]]) + [arr[0]] + quicksort([x for x in arr[1:] if x>=arr[0]])
Really great. This is the best video for quick sort i have seen
Great…
Nice
This is actually the best video on it, that I have come across – so thank you 🙏
I do not really understand Quick Sort,anyone help?