How can you mathematically represent the performance of Line

How can you mathematically represent the performance of “Linear Search” and “Binary Search”?

Solution

Binary Search

log2(2x)    = log2 N
x * log2(2) = log2 N
x * 1         = log2 N

Linear search

n if k=0
(n+1)/(k+1) if 1<=k<=n

How can you mathematically represent the performance of “Linear Search” and “Binary Search”?SolutionBinary Search log2(2x) = log2 N x * log2(2) = log2 N x * 1 =

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site