Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Sleep sort (2011). Parent comment
E.g.
Intput, T: array of n elements, m: number of distinct elements.
for i in 1..m for j in 1..n if( T[j] == i ) print T[j];
There are no comments on this comment yet.
E.g.
Intput, T: array of n elements, m: number of distinct elements.
This is O(n * m) which is O(n) since m is a constant.