子集枚举——状态压缩应用手段之一
function get_subset(bitmask)
subset = bitmask
answer = [bitmask]
while subset != 0
subset = (subset - 1) & bitmask
put subset into the answer list
end while
return answer
end function
function get_subset(bitmask)
subset = bitmask
answer = [bitmask]
while subset != 0
subset = (subset - 1) & bitmask
put subset into the answer list
end while
return answer
end function