我想要做的是如下: 输入:n,例如n = 3的 输出:{000,001,010,011,100,101,110,111},生成所有子集,我不在乎 我实现了一个算法的子集的顺序: for (long i = 0, max = 1 << n; i < max; i++) {
for (int j = 0; j < n; j++) {
// check if the j bit i
这是算法书的任务。 事情是我完全不知道从哪里开始! Trace the following non-recursive algorithm to generate the binary reflexive
Gray code of order 4. Start with the n-bit string of all 0’s.
For i = 1, 2, ... 2^n-1, generate