Re: set intersection -> true/false



Oana wrote:
)>
)> This question has already been answered on this newsgroup within the last
)> few weeks. It must be a popular question with programming instructors.
)>
)> Use a hash table.
)>
)>
)> SaSW, Willem
)
) Thanks. But i'm afraid it's not that very straight forward,
) at least not for me. I looked for older posts but didn't find
) any clue yet. i'll keep on looking...

If you can use STL, haven't you got a hash table implemented already ?
It may be called a map or mapping or something like that.

In any case, a hash table (or whatever it's called) is, for this problem,
a datatype where you can check in O(1) time if a given entry is already
in the table. Usually hash tables have 'keys' and 'values', but in this
case you just need the 'keys'.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.


Quantcast