Quicksort

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

This is actually the best video on it, that I have come across - so thank you 🙏

NinaHProductions
Автор

2:52 Correction: *10 is bigger than the pivot (8 is the pivot)

krishnaprasad
Автор

Really great. This is the best video for quick sort i have seen

rahul
Автор

i watched tons of video regarding quick sort but so far this is the best and easiest one...

ahsanhussain
Автор

This best video for quick sort and quick select, youtube algorithm please make a note of it, don't trouble peeps prepping for interview with some other video in ranking, make this always first!

darshanprakash
Автор

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.

md
Автор

I must give a big thumb to this YouTuber. This video is most understandable i have ever seen.

guanbinhuang
Автор

Thank you from all ukrainian CS students!

ruslan_yefimov
Автор

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

whatidashdashdash
Автор

2:52 - small correction - "10* is bigger than the pivot"

EndsTonightEnzomyte
Автор

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?

PetersFXfilms
Автор

your explanation is amazing, good job and thank you!

ikzirra
Автор

I do not really understand Quick Sort,anyone help?

hungryno
Автор

this udacity video has the audacity to put every other quick sort video to rest.

darshanprakash
Автор

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

RaniLink
Автор

what is this swapping thing, that's not quicksort

le-hu
Автор

basically, choose a pivot then put values > pivot to right else to left then bubble sort each side.

kyde
Автор

But i wish you can also offer the implementation of it in python. Thanks!

guanbinhuang
Автор

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]])

AalokKamble
Автор

This doesn't explain it programmatically. It makes no sense from a person trying to actually write code to implement it.

FINSuojeluskunta
welcome to shbcf.ru