I Made Sorting Algorithms Race Each Other

preview_player
Показать описание


⭐ Other Social Media Links:

✨ Subscriber count: 11,754 subscribers 💚
Рекомендации по теме
Комментарии
Автор

There is a parallel universe where bogo sort won.

maxwell
Автор

So you technically sorted the sorting algorithms

KebabTM
Автор

Next, make them *arm wrestle*…. Two sorting algorithms, one list; one trying to sort the list ascending, the other descending.

JensRoland
Автор

The reason .sort() is faster than the other ones is because it was programmed in C, while the ones you made are in python.

maxwell
Автор

Me: can we have code bullet? Mom: we have code bullet at home. Code bullet at home:

Kristanoppersma
Автор

Should have implemented some of them with threads, as mergesort and quicksort are easy to parallelize and get much faster. For Quicksort, you don't even need synchronization.

morl
Автор

You should make different categories with different amounts of elements, for example 10, 100, 1k, 10k, 100k, ... and see how for example insertion sort dominates everything for the lowest category (if it is few enough elements), then quicksort dominates everything in the middle and then the big O complexity of radix sort enables it to outrun everyone else.
Also, it would be in the spirit of Olympics because there are different sports (= different categories)

Nice video though, you deserve way more subscribers!

redder
Автор

5:50 got me so confused, you speak about radixsort while showing bubble sort and bucket sort 😅

mciek
Автор

You should host a Nerd Olympics. I had never been more excited to watch sorting algorithms in my life! Good video.

chiragbellara
Автор

Awesome video! I think a potential factor in why the tournament results were a bit off comes from how the n value was changed from bracket to bracket. Because of the different time complexities, some sorting algorithms might work faster with smaller values and so they might start floundering as the list size increases.

isaacsanchez
Автор

There should be separate categories for algorithms that need extra memory, and ones that dont.

maxwell
Автор

in a perfect universe Bogosort wins everytime

ShadwWarrr
Автор

Very interesting. Thanks for your work. Looking forward to the next one.

aoch
Автор

You seem to be having fun. What if you are sorting containers in a port. Now what matters is not really the number of swaps, but the total distance that the crane will have to travel because that crane is really slow. Is that going to impact which algorithm wins? I think it's time for container sort Olympics 😅

xavierdupont
Автор

Why we have all of these to begin with:
- some algorithms are what we call "stable". this means that the order of elements that have the same value for the property we are sorting on does not change
- some algorithms work in-place, whereas others need to make a copy of the list. Algorithms that are not in-place use more memory and sometimes don't utilize CPU cache well.
- the speed of an algorithms sometimes depends on what list you are sorting.

Quicksort has a best-case time complexity of O(n log n). but it can perform as bad as O(n^2), if the list is organized such that the chosen pivot is a minimum or a maximum of the current slice. Merge sort on the other hand, has a time complexity of O(n log n) no matter what.

- Finally, radix sort is a bit different from the rest. It performs O(nk), where k is the average number of digits a number has in the list. But the trouble is that radix sort is unwieldy to implement when you want to sort data that isn't plain integers or strings. also, if your list is small and your number of digits high, radix sort can be as bad as bubble sort.

peppidesu
Автор

This deserves more views. As a programmer, this is pretty investing and cool

jyotiradityashukla
Автор

While this is small enough that they probably won't bother you, I did want to let you know that the Olympics is a trademarked or copyrighted thing and they _do_ go after some creators. The one I'm thinking of is a really big one, the MarbleLympics (now Marble League). Not a criticism or saying you should change anything. Just thought I'd shoot you an fyi

HmmmmmLemmeThinkNo
Автор

I like watching random sorting algorithms, but it’s nice having someone talk about them while I watch

andrewevenson
Автор

Bogo sort has the potential to sort an array in linear time but it has one in billion chance of doing it.

sg
Автор

I really like your character, and AAAAH YEAH MERGE SORT LOOKS COOL

theopoldthegamer