4 ms·
To be fair, average case is useful. It's the reason probabalistic algorithms like quicksort (O(N^2)) and hash tables (O(N)) can work at all in practice. The cat
by a1369209993 5y ago
To be fair, average case is useful. It's the reason probabalistic algorithms like quicksort (O(N^2)) and hash tables (O(N)) can work at all in practice. The catch is you have to know what distribution your average is being taken over (Hash tables can be assumed to be a uniform distribution if your hash function is good enough; quicksort can be a uniform distribution, but noone writes it that way until after it blows up in their face, if then.)
You do have to know about worst case behaviors.
There are no circumstances where best case behavior is worth even calculating for anything other than curiousity, unless you're trying to deny said behavior to a cryptographic adversary (so it's actually your worst case).