Re:Imperative vs. Declarative
by textminer on Tuesday April 02, 2013 @02:09PM
(#5481047)
The pedant in me squirms at seeing a quadratic-time solution to something so linear. Use a heap or a scan, sir!
[ Parent
| on HN ]
Oh, now I have to yell at myself. No doubt Python's sorted is some n*logn quicksort, and not actually in quadratic time. Crow for all!
It's an adaptive mergesort-based sort: http://en.wikipedia.org/wiki/Timsort