Re: set intersection -> true/false
- From: oanacb@xxxxxxxxx (Oana)
- Date: 31 May 2005 08:31:16 -0700
Willem <willem@xxxxxxxx> wrote in message news:<slrnd9og8b.826.willem@xxxxxxxxxxxxx>...
> 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.
yes. maps.
>
> 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'.
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.
With maps i still don't see how to make the comparison...but thanks
again.
.
- Follow-Ups:
- Re: set intersection -> true/false
- From: Willem
- 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
- Re: set intersection -> true/false
- From: Willem
- set intersection -> true/false
- Prev by Date: Re: set intersection -> true/false
- Next by Date: Re: Creationist software engineering? A frightening possibility!
- Previous by thread: Re: set intersection -> true/false
- Next by thread: Re: set intersection -> true/false
- Index(es):
Relevant Pages
|