![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
bit manipulation
Yingying_code
这个作者很懒,什么都没留下…
展开
-
461. Hamming Distance*
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y 31.原创 2017-01-15 18:57:36 · 282 阅读 · 0 评论 -
476. Number Complement*
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range原创 2017-01-15 19:06:15 · 1051 阅读 · 0 评论 -
405. Convert a Number to Hexadecimal*
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used. Note: All letters in hexadecimal (a-f) must be in lowercase.The hexade原创 2017-01-16 10:13:06 · 258 阅读 · 0 评论 -
477. Total Hamming Distance**
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total Hamming distance between all pairs of the giv原创 2017-01-16 23:34:32 · 252 阅读 · 0 评论 -
201. Bitwise AND of Numbers Range**
Given a range [m, n] where 0 For example, given the range [5, 7], you should return 4. public class Solution { public int rangeBitwiseAnd(int m, int n) { if(m==0) return 0;原创 2017-02-26 14:22:38 · 250 阅读 · 0 评论