News for hackers. Stuff that matters.
Re:A bad citizen in Javaland (2006) by moron4hire on Thursday December 03, 2015 @08:47AM (#10669494)
Best-case runtime = 1. Worst-case = infinity.
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.
Re:A bad citizen in Javaland (2006) by danieldk on Thursday December 03, 2015 @09:38AM (#10669748)
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).

Re:A bad citizen in Javaland (2006) by lisivka on Thursday December 03, 2015 @10:57AM (#10670257)
Optimize out the check, so it will be O(1) in some cases. ;)