Hash table element existence check

Illuminati via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 3 05:33:26 PDT 2016


On Saturday, 3 September 2016 at 07:44:28 UTC, Cauterite wrote:
> On Friday, 2 September 2016 at 19:38:34 UTC, Illuminati wrote:
>> I am trying to create a hash table and would like an efficient 
>> way to be able to know if an element exists to test for 
>> collisions.
>
> Just do a regular lookup on the hash? It's an O(1) operation, 
> like 4 instructions.

Huh? One can look up fine, but how does one know if the result is 
valid or not?


More information about the Digitalmars-d-learn mailing list