Give the name of a wellknown algorithm whose worstcase runni

Give the name of a well-known algorithm whose worst-case running time is O(log(n)

Solution

.   Big Oh (O):

When we say that an algorithm runs in time T(n), we mean that T(n) is an upper bound on the running time that holds for all inputs of size n. This is called worst-case analysis.

Binary search tree is the data structure having worst case time O(log(n)).

In terms of algorithm, Binary Search is the algorithm having worst case time O(log(n)).

Any algorithm that repeatedly divides the input size by some fraction will need O(log n) iterations to terminate. Those iterations might take a lot of time and so the net runtime needn\'t be O(log n).

Example: Binary Search

Thank you.

 Give the name of a well-known algorithm whose worst-case running time is O(log(n)Solution. Big Oh (O): When we say that an algorithm runs in time T(n), we mean

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site