Re: Hash
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Wed, 27 Dec 2006 16:16:58 +0000
Douglas Dude said:
Richard Heathfield wrote:
Douglas Dude said:
How much time does it take to look for a value or key in a hash_map
keyvalue pair ?
About 10 minutes. 30 microseconds. A few months. It kind of depends,
really.
Please help me confirm the O-notation. I always think it is O(1), is
this correct?
Ah! Time *complexity*. Well, that depends on the implementation of the
algorithm, of course, but it's possible, given a key, to locate its
associated value in O(1) if you have a perfect hash. And if you don't, the
complexity depends on your mechanism for resolving collisions.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.
- Follow-Ups:
- Re: Hash
- From: dcorbit
- Re: Hash
- Prev by Date: Re: I need a super small program written
- Next by Date: Re: Command Line Interpreter
- Previous by thread: Re: Hash
- Next by thread: Re: Hash
- Index(es):
Relevant Pages
|
|