Bit+Operations

for (int i = 1; i < (1 << n); ++i)  setSize[i] = setSize[i & (i - 1)] + 1;

for (int childSet = possibleSet; childSet != 0; childSet = (childSet - 1) & possibleSet)