Reputation: 45
Assume I have regular binary search, but I change the mid
to 2/3*(min+max)
.
Will the running time change, or remain (log(n)
)?
I got c1+c2*log(n)/log(3/2)
.
Upvotes: 1
Views: 70
Reputation: 18148
It'll still be log(n). You'll have a different log base (3/2 instead of 2), but changing a log base is the same as multiplying by a constant.
Upvotes: 3