how to get all permutations for bitarray
<p>how to generate all permutations for bitarray of n size?</p>

<p>I mean for example if array of 1 and 0 has integer type I can do like this</p>

<pre><code>for (int i = 0; i &lt;= ~(-1 &lt;&lt; n); i++)
   string s = Convert.ToString(i, 2).PadLeft(n, '0');
</code></pre>

<p>and s will contain some permutation for example 101010 or 100000 and etc.
So I can get all permutations.
For example for n=3</p>

<pre><code>000
001
010
011
100
101
110
111
</code></pre>

<p>But how to do the same for bitarray?(because I need XOR operations and etc.)</p>
