You know what this blog needs? More power_set().

As luck would have it, an email got sent out to our coders list today asking about power set functionality in java. I flippantly replied with my implementation, saying that I was sure that the java equivilent would be just as elegant.

A witty exchange of emails followed (the sort of thing that makes you love working at an engineering oriented company), and Jim made the point that all the offered implementations were horribly memory inefficient. He offered an iterator-based solution in java.

Well, I for one am not going to stand here and let our favorite little programming language have its name dragged through the mud. So here was the iterative-based solution I came up with:

Pasted Graphic 2
|