4 ms·
That's definitely a fair way to describe things (even if it is strictly less precise than just saying "log_32") but if you're going to do that, you should call
by clhodapp 9y ago
That's definitely a fair way to describe things (even if it is strictly less precise than just saying "log_32") but if you're going to do that, you should call all of the logarithmic-in-size operations "effectively constant". Having a bounded max of e.g. 30 lookups isn't markedly different from having a bounded max of 6. Basically... my claim is that it's misleading for the Scala docs to draw the distinction where they've drawn it.
Edit: Ah! I messed up the first sentence of my original comment but it seems to be too late to edit it! I meant to say "log_2(x) is only a constant factor of 5 off of log_32(x)".
- wtetzner 9y ago> Basically... my claim is that it's misleading for the Scala docs to draw the distinction where they've drawn it. Yeah, I see where you're coming from. I guess it would be constant time if they made sure lookups always took as long as the worst case :)