汉明距离 两个整形数据 二进制表示中 不同 bit 的个数
code
int hammingDistance(int x, int y) {int count = 0;int x1,y1;for(int i=1;i<=32;i++){int x1 = x&0x01;int y1 = y&0x01;if( x1!=y1 ){count++;}x = x>>1;y = y>>1;}return count;
}
int hammingDistance(int x, int y) {int count = 0;int x1,y1;for(int i=1;i<=32;i++){int x1 = x&0x01;int y1 = y&0x01;if( x1!=y1 ){count++;}x = x>>1;y = y>>1;}return count;
}