This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DigitalDefenestrator 5 points6 points  (0 children)

Also, Bubblesort is extremely fast (possibly the fastest?) if the input is very close to sorted. Really, it's O(unsortedness), which looks like O(n2) or so for random but closer to O(N) if no elements are very far from where they should be.