Quicksort

Quicksort

Udacity

8 лет назад

118,230 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@hungryno2297
@hungryno2297 - 12.11.2017 17:43

I do not really understand Quick Sort,anyone help?

Ответить
@NinaHProductions1
@NinaHProductions1 - 29.03.2018 01:07

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

Ответить
@jackie1453
@jackie1453 - 28.06.2018 09:19

Nice

Ответить
@sgrmdsaif07
@sgrmdsaif07 - 01.07.2018 20:52

Great...

Ответить
@rahul12500
@rahul12500 - 21.07.2018 17:30

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

Ответить
@AalokKamble
@AalokKamble - 19.09.2018 22:18

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

Ответить
@RaniLink
@RaniLink - 16.10.2019 18:45

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

Ответить
@whatidashdashdash8866
@whatidashdashdash8866 - 23.01.2020 11:44

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

Ответить
@ruslan_yefimov
@ruslan_yefimov - 25.05.2020 03:09

Thank you from all ukrainian CS students!

Ответить
@guanbinhuang3027
@guanbinhuang3027 - 28.05.2020 03:51

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

Ответить
@ikzirra273
@ikzirra273 - 16.10.2020 11:21

your explanation is amazing, good job and thank you!

Ответить
@FINSuojeluskunta
@FINSuojeluskunta - 11.11.2020 04:29

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

Ответить
@m22d52
@m22d52 - 22.11.2020 02:36

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.

Ответить
@ahsanhussain4470
@ahsanhussain4470 - 18.12.2020 14:33

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

Ответить
@le-hu
@le-hu - 14.01.2021 02:03

what is this swapping thing, that's not quicksort

Ответить
@jawid2250
@jawid2250 - 12.02.2021 15:14

Best explanation ever !

Ответить
@kudzanaijamu6566
@kudzanaijamu6566 - 26.04.2021 15:51

Zvikukwidibira

Ответить
@kyde8504
@kyde8504 - 25.05.2021 14:42

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

Ответить
@ethansims1373
@ethansims1373 - 09.09.2021 15:18

what?

Ответить
@ajourneyofabeginner
@ajourneyofabeginner - 18.12.2023 22:02

best best best

Ответить
@darshanprakash
@darshanprakash - 04.04.2024 09:40

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

Ответить