Re: set intersection -> true/false
- From: Willem <willem@xxxxxxxx>
- Date: Tue, 31 May 2005 10:48:43 +0000 (UTC)
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
.
- Follow-Ups:
- Re: set intersection -> true/false
- From: Oana
- Re: set intersection -> true/false
- References:
- set intersection -> true/false
- From: oanacb
- Re: set intersection -> true/false
- From: Willem
- Re: set intersection -> true/false
- From: Oana
- set intersection -> true/false
- Prev by Date: Re: set intersection -> true/false
- Next by Date: HOW to click on a button from command line?
- Previous by thread: Re: set intersection -> true/false
- Next by thread: Re: set intersection -> true/false
- Index(es):