Suppose a bit-vector with 2^n bits. It is a balanced bit-vector if it has exactly 2^(n-1) bit 1 (so does bit 0). Given n, can I print out all 2^n-bit balanced bit-vector in O(2^n)?
Suppose a bit-vector with 2^n bits. It is a balanced bit-vector if it has exactly 2^(n-1) bit 1 (so does bit 0). Given n, can I print out all 2^n-bit balanced bit-vector in O(2^n)?
You can't.
Printing single 2^n bits vector takes O(2^n) time, and printing all possible vectors takes O(2^n*nCr(2^n, 2^(n-1))) - much more.