Remix.run Logo
NooneAtAll3 5 hours ago

counting sort is O(nW), where W is largest value

if you don't care about W or it is essentially constant - then it can be dropped

but it is an input parameter that will change execution time

marcosdumay 3 hours ago | parent | next [-]

It's O(n+W), not O(n*W).

> if you don't care about W or it is essentially constant - then it can be dropped

Also, every algorithm that ends in a real computer is bound to a constant time. That's still not a practical thing to do.

emil-lp 4 hours ago | parent | prev [-]

W is the span or range.