Re: set intersection -> true/false



oanacb@xxxxxxxxx wrote:
) i am looking for an algorithm that without calculating/storing the
) result of a set intersection (i have rather large sets...and a lot of
) them) gives just a bool value - true : the sets have an non-void
) intersection; or - false : the sets are disjoint. So to say, it stops
) after it finds the first common element of the two sets.
) If i write it myself, even if it stops, the function still takes
) a lot of time :( ; much faster it goes with STL set-intersection but
) then of course the whole intersection set is computed.
) thanks a lot! grateful for any ideas...

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
--
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
.



Relevant Pages

  • Re: Why are stop signs so common in the US?
    ... Much of the world doesn't use 4 way stops ... I never saw any when I was growing up in Massachusetts. ... Now in California, ... bearing down on the intersection at 40mph before proceeding. ...
    (misc.transport.road)
  • Re: Why are stop signs so common in the US?
    ... Much of the world doesn't use 4 way stops ... I never saw any when I was growing up in Massachusetts. ... Now in California, ... bearing down on the intersection at 40mph before proceeding. ...
    (misc.transport.road)
  • Re: California traffic fines
    ... you stops and you can't clear the intersection before your light turns red. ... You are therefore blocking the intersection when it is green for others. ... opposing traffic stops for the red light I quickly make my turn. ...
    (rec.outdoors.rv-travel)
  • set intersection -> true/false
    ... i am looking for an algorithm that without calculating/storing the ... intersection; or - false: the sets are disjoint. ... If i write it myself, even if it stops, the function still takes ...
    (comp.programming)