[Haskell-cafe] O(n) algorithm for determining subset
Eugene Kirpichov
ekirpichov at gmail.com
Sun Nov 15 16:03:54 EST 2009
It's simpler: "x&~y == 0"
2009/11/15 Michael Mossey <mpm at alumni.caltech.edu>:
> Can someone tell me if this is correct. I'm guessing that if I represent
> two sets of integers by Word32 (where ith bit set means i is in the set),
> then an algorithm to determine if x is a subset of y would go something
> like
>
>
> (y - x) == (y `exclusiveOr` x)
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
--
Eugene Kirpichov
Web IR developer, market.yandex.ru
More information about the Haskell-Cafe
mailing list