sorting - Is it true or false that, for any algorithm, its average-case performance is always better than the worst-case performance asymptotically -
i'd think true, i'm not confident in answer. there algorithm has equal running time in both average , worst case. i'm not sure if answer true then.
calculating 1+1=2 o(1) in best, average, , worst case.
a less trivial example: determining length of linked list of length n takes n steps in cases, it's o(n) in cases.
Comments
Post a Comment