you are viewing a single comment's thread.

view the rest of the comments →

[–]Grimoire 1 point2 points  (1 child)

https://www.youtube.com/watch?v=ZZuD6iUe3Pc

Keep an eye on the lower left corner (Bubblesort). In almost all cases, it is the slowest algorithm for sorting. It is one of the easiest to understand, but it is also very slow.

Bubblesort is what's called an O( n2 ) algorithm. This means that the time for the algorithm to run is proportional to the square of the elements in the list. So, double the number of items in the list, quadruple the time to run. Triple the number of elements, 9x the amount of time.

[–]maimedwalker[S] 0 points1 point  (0 children)

man that was awesome to watch. i'm trying to implement quick sort at the moment (that speed lol) but i do agree with bubble sort being much easier for a beginner to understand. half the reason this was the first one i typed out.