例えば、私は、次のC++構造を持っている...私は間違っていない場合 struct dleaf_t
{
int contents; // OR of all brushes (not needed?)
short cluster; // cluster this leaf is in
short area : 9; // area t
O(n)時間のビットを反転させるこのコードを理解しようとしています。私は時間の複雑さを理解していますが、このコードの背後にあるロジックを理解することはできません。 public static long reverse(long a) {
long result = 0;
int i = 31;
while(a > 0){
result += (a % 2