java - Time complexity of creating hash value of a string in hashtable -


it's said inserting , finding string in hashtable o(1). how hash key of string made ? why it's not o(l), length of string? it's clear me why integers it's o(1), not strings.

note that, understand why in general, inserting hashtable o(1), confused before inserting hash table, making hash value phase.

and there difference between how hash keys strings produced between hashtable in java , unordered_map in c++?

inserting etc. in hashtable o(1) in sense constant in number of elements in table.

the "o(1)" in context makes no claim how fast can compute hashes. if effort grows in way, way is. however, find unlikely complexity of decent (i.e. "fit application") hash function ever worse linear in "size" (i.e. length in our string-example) of object being hashed.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -