http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=bitManipulation
iterate over all the subsets of a particular subset (represented by a bit pattern)
So the iteration step is just i = (i - 1) & superset.
for(s = superset; s >= 0; s = s?((s-1)&superset): -1){
}