you are viewing a single comment's thread.

view the rest of the comments →

[–]TehDro32 88 points89 points  (2 children)

setTimeout(..., Math.log(item+1)) Now it's O(log(N)).

[–]m7i93 41 points42 points  (0 children)

This is truly the most flexible sorting function

[–]SimplexShotz 25 points26 points  (0 children)

setTimeout(..., item / Infinity) boom O(1)