bit * increment(bit *x) { int i = n-1; while (i >= 0 && bit[i] == 1) { bit[i] = 0; i--; } if (i >= 0) bit[i] = 1; return bit; }