Showing posts with label Power_set. Show all posts
Showing posts with label Power_set. Show all posts

Sunday, 14 July 2013

Simple Power Set Generator

Currently I was trying to code some algorithm that one of my friend told me to do. In that algorithm I needed the code of a power-set generator. I first tried to code in my own way but it proved to be not so much simple. Then I found another simple logic to generate power-set. Logic is simple if you want the power-set of a set with n number of elements then just generate all the combination of n boolean variables.