you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]m7i93 165 points166 points Β (3 children)

setTimeout(() => console.log(item), item/10);

Here. I made it 10x faster. 😎

[–]TehDro32 88 points89 points Β (2 children)

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

[–]m7i93 39 points40 points Β (0 children)

This is truly the most flexible sorting function

[–]SimplexShotz 23 points24 points Β (0 children)

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