Hacker News new | ask | show | jobs
by meryn 4828 days ago
Thinking this through some more, using sort with a comparator function would be unnecessary slow. Given the objective of the algoritm (return a median), it's much better to convert the array of strings to an array of floats (or ints, whatever he wants) first.
1 comments

Or to simply use a selection algorithm instead of a sort, since they are asymptotically faster.