Re:Advanced Javascript tips and tricks
by omaranto on Tuesday July 05, 2011 @05:02AM
(#2729139)
Fisher-Yates is a better idea, of course, since it is pretty short and runs in linear time, but if someone insists on a sort-based one-linear this should work:
[ Parent
| on HN ]
Argh, I missed the edit time window: "one-linear", should be, of course, "one-liner". Fisher-Yates is O(n), but the sort makes this algorithm Omega(n log n).
What's 'Omega'?
Re:Advanced Javascript tips and tricks
by throw_away on Wednesday July 06, 2011 @04:06AM
(#2732954)
omega() is like the opposite of O(). it means "at least" rather than "at most". — http://en.wikipedia.org/wiki/Big_Oh_notation#Family_of_Bachm...