News for hackers. Stuff that matters.
Re:Ask HN: Could you share your personal blog here? by jackblemming on Tuesday July 04, 2023 @10:49PM (#36595000)
Can you explain how sleepsort is constant time when it requires looping through n items?
Re:Ask HN: Could you share your personal blog here? by wetmore on Wednesday July 05, 2023 @12:00AM (#36595389)
The runtime is bounded by K, where all numbers you sort are less than K.
Re:Ask HN: Could you share your personal blog here? by jackblemming on Wednesday July 05, 2023 @12:40AM (#36595572)
From an analysis perspective, I do not believe you can call an O(n) algorithm constant because you could run it on a computer with n cores.

From a practical perspective, I do not believe it is bounded by K, where all numbers you sort are less than K. Consider an array of one hundred trillion items, each being the number 1. This is bounded by the array length, not the number 1.

Re:Ask HN: Could you share your personal blog here? by xena on Wednesday July 05, 2023 @04:39AM (#36597533)
Realistically, I don't know what the complexity of that algorithm is or if it's possible to have one. Making the argument it is constant time is intended to be a bit of a joke at how difficult it is to give it a time complexity. My interpretation of it as constant time (temporal multiplicand multiplied by the largest value in the list) is going by wall clock time, which is arguably the time that matters in an interview.