For a logarithmic search, the time would be
T ~= constant * log(N)
T / log(N) ~= constant
So to estimate the time T2
for size N2
given time T1
for size N1
:
T2 / log(N2) ~= T1 / log(N1)
T2 ~= T1 * log(N2) / log(N1)
~= 0.00096ms * log(1000000) / log(290024)
~= 0.00105ms
For a constant-time hash lookup, the time won’t change. In practice, it probably won’t quite be constant-time; but there’s no simple way to estimate what it will be.
1
solved Execution time of C++ algorithm [closed]