Комментарии:
I do not really understand Quick Sort,anyone help?
ОтветитьThis is actually the best video on it, that I have come across - so thank you 🙏
ОтветитьNice
ОтветитьGreat...
ОтветитьReally great. This is the best video for quick sort i have seen
Ответить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]])
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..
Ответить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...
Thank you from all ukrainian CS students!
ОтветитьBut i wish you can also offer the implementation of it in python. Thanks!
Ответитьyour explanation is amazing, good job and thank you!
ОтветитьThis doesn't explain it programmatically. It makes no sense from a person trying to actually write code to implement it.
Ответить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.
i watched tons of video regarding quick sort but so far this is the best and easiest one...
Ответитьwhat is this swapping thing, that's not quicksort
ОтветитьBest explanation ever !
ОтветитьZvikukwidibira
Ответитьbasically, choose a pivot then put values > pivot to right else to left then bubble sort each side.
Ответитьwhat?
Ответитьbest best best
Ответитьthis udacity video has the audacity to put every other quick sort video to rest.
Ответить