Re: set intersection -> true/false
- From: Willem <willem@xxxxxxxx>
- Date: Tue, 31 May 2005 17:10:12 +0000 (UTC)
Oana wrote:
) i think i'll just copy the STL source code for set-intersection and
) modify it (for me) to stop after first occurence.. I have these 2 sets
) - (ordered; unique lists), i iterate through both; iterators just go
) further when they are smaller than the other one, simetrically, and if
) equal, return true instead of storing in the third iterator. Then one
) goes just one time through the sets.
Are the sets ordered then ? In that case, your approach is indeed
the best way. I was thinking about unordered sets.
) With maps i still don't see how to make the comparison...but thanks
) again.
Stick one array in the map. Walk through the other array and see
if any element is in the map.
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
.
- References:
- set intersection -> true/false
- From: oanacb
- Re: set intersection -> true/false
- From: Willem
- Re: set intersection -> true/false
- From: Oana
- Re: set intersection -> true/false
- From: Willem
- Re: set intersection -> true/false
- From: Oana
- set intersection -> true/false
- Prev by Date: Re: How to name variables in a program?
- Next by Date: Re: Advice for mid-life career change (to programming)
- Previous by thread: Re: set intersection -> true/false
- Next by thread: Re: set intersection -> true/false
- Index(es):
Relevant Pages
|