Re:A bad citizen in Javaland (2006)
by moron4hire on Thursday December 03, 2015 @08:47AM
(#10669494)
Best-case runtime = 1. Worst-case = infinity.
[ Parent
| on HN ]
Re:A bad citizen in Javaland (2006)
by AndrewOMartin on Thursday December 03, 2015 @09:37AM
(#10669745)
I think the joke is that in all cases but the best-case, you won't be around to observe it, this becomes practical once you can create a universe for every permutation and destroy all but the universe which notifies you that it's the best-case.
In all good text books this is left as an exercise for the reader.
Re:A bad citizen in Javaland (2006)
by AnimalMuppet on Thursday December 03, 2015 @12:38PM
(#10671041)
In a really good text book, this is left as an exercise that the reader won't do.
No, checking whether a list is sorted is O(n) ;).
Bogosort is O(n) in the best case and O(inf) in the worst case).