
bit manipulation
文章平均质量分 59
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 · 325 阅读 · 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 · 1094 阅读 · 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 · 304 阅读 · 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 · 292 阅读 · 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 · 278 阅读 · 0 评论