3 ms·
> in constant time why is it called constant time if it isn't constant with respect to array length? Just seems confusing because the algorithm is linear witho
by hellfish 4y ago
> in constant time
why is it called constant time if it isn't constant with respect to array length? Just seems confusing because the algorithm is linear without a short circuit
- namkt 4y agoIt's constant time in that it always takes the same amount of time regardless of the extent to which the two strings are equal. It is a different concept than constant time in complexity analysis. What's even more confusing is that it is also constant time in the complexity analysis sense given that the mac is usually a fixed-size string after choosing a hashing algorithm.