4 ms·
Computing the hash of a string with n characters is O(n). However, the whole discussion in the piece suffers from not taking into account the fact that words d
by FabHK 4y ago
Computing the hash of a string with n characters is O(n).
However, the whole discussion in the piece suffers from not taking into account the fact that words don't get arbitrarily long. Thus, insofar that for all practical purposes n <= 30, say, it is indeed O(30) = O(1).