Hot answers tagged


The first argument does help with a rigorous refutation for the statement. If you want to really be formal, here is how you should approach it (its not a formal proof, but more of a sketch for how you should prove it formally): Assume towards contradiction there is some algorithm $A$ that solve this question in $o(n)$ time. Since the run-time of $A$ is ...


This one seems to be working well for me. Try out without the swap function.


This would depend on context. You can't do a comparison based sort with less than log (n!) comparisons, and that's $\Theta(n \log n)$. But the statement doesn't say "comparisons", it says "time". With unlimited resources, say with $n^2$ processors that can all run in parallel, it might very well be possible. Finding the maximum of n ...


This might be helpful. There might be other websites too.

Only top voted, non community-wiki answers of a minimum length are eligible