logoalt Hacker News

NooneAtAll3yesterday at 6:24 PM2 repliesview on HN

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


Replies

marcosdumayyesterday at 7:58 PM

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-lpyesterday at 7:22 PM

W is the span or range.