3 ms·
I suppose the general idea for the colors is something like: green = best in category, red = worst in category, yellow = neither best nor worst? In that case b
by anonymouz 13y ago
I suppose the general idea for the colors is something like: green = best in category, red = worst in category, yellow = neither best nor worst?
In that case bubble sort and insertion sort should be green for the best-case time complexity ( O(n) vs. O(n log(n)) for quicksort/mergesort).
It might also be interesting to make the plot dynamic and allow the visitor to play with different implicit constants for the individual asymptotic bounds.
- agf 13y agoThey've got the tables on github and I threw up a pull request to fix several color problems w/ the sorting table including this one, and also to add heapsort.
- pbiggar 13y agoWhen reading it, I felt that red was "don't use in production", green was "fine to use in production" and yellow was "maybe use in production".
- sbov 13y agoExcept insertion sort is faster than quicksort for smaller N because of the overhead involved in quicksort - quicksort has large constants which big-O notation isn't designed to show. This is why many library sorting algorithms fall back to insertion once the things you are sorting gets small enough.
- pbiggar 13y agoAll "don't use in production" tags should be accompanied by "unless you really know what you're doing".
- Zarel 13y agoIt seems to be just: O(1) green O(log n) green O(n) red O(n log n) yellow O(n^2) red Which is weird, since green-green-red-yellow-red is a really confusing order. I don't know why they did it that way.