News for hackers. Stuff that matters.
Re:Trolling homework questions - sorting by mihai_ionic on Friday December 27, 2013 @08:37PM (#6973475)
And it even has the best time bound you can get for a comparison based sort. Most OS schedulers would use a heap/priority queue internally for timers, which makes sleep sort O(n log n).
Re:Trolling homework questions - sorting by gizmo686 on Friday December 27, 2013 @09:26PM (#6973580)
wouldn't sleep sort be O(k), where k is the largest element to be sorted? (Assuming the clock and scheduler are precise enough to achieve the correct answer the first attempt).
Re:Trolling homework questions - sorting by mihai_ionic on Friday December 27, 2013 @09:35PM (#6973612)
I would't really count time passing as an operation, since other programs are able to run during that time.
Re:Trolling homework questions - sorting by gweinberg on Saturday December 28, 2013 @12:51PM (#6975560)
You could keep it linear by first going through the list to find the max, then scaling down.