Compute Runtime for Logarithmic Algorithm