Hi. I need a c/c++ code, which generates the subsets of a given set. i could not find anywhere on the internet. If you help me, i will be glad.
i have an array which is wArray[] that has length 5 for example.
wArray = {1,2,3,4,5}
this array is the weight array (it contains the weights of some items), so the subsets of it will be:
how can i generate subsets of this set and assign it to a different array?Code:sArray = {1,2,3,4,5,(1+2),(1+3),(1+4)....,(1+2+4),....(1+2+3+4+5)}
Thank you...