1.

Distinguish between worst-case running time and best-case running time in algorithm analysis; and give relevant practical examples to illustrate your answer

Answer»

Best case is the FUNCTION which performs the MINIMUM number of steps on INPUT data of N elements. Worst case is the function which performs the maximum number of steps on input data of size n.Explanation:The best, worst, and average cases of a given algorithm express what the resource usage is at least, at most and on average, respectively. Usually the resource being considered is running TIME, i.e. time complexity, but could also be memory or other resource.



Discussion

No Comment Found