![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
位运算
peace in mind
这个作者很懒,什么都没留下…
展开
-
[leetcode] Reverse Bits
题目链接在此Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as原创 2015-08-12 14:37:33 · 367 阅读 · 0 评论 -
[LeetCode] Hamming Distance(二进制中有多少个1)+ Number Complement(补码)
啊,又是好久没来了!最近又开始刷leetcode,发现题目多了不少。还是从基础开始做吧。这里是两道关于位运算的题。1. Hamming Distance题目链接在此The Hamming distance between two integers is the number of positions at which the corresponding原创 2017-02-16 18:35:54 · 398 阅读 · 0 评论 -
(位运算总结)A summary: how to use bit manipulation to solve problems easily and efficiently
原帖在此WIKIBit manipulation is the act of algorithmically manipulating bits or other pieces of data shorter than a word. Computer programming tasks that require bit manipulation include l转载 2017-02-17 11:40:40 · 975 阅读 · 0 评论 -
[LeetCode] Sum of Two Integers(用位运算实现加法)
题目链接在此Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.要求代码里不能出现 + 和 - 符号,只能用位运算咯。这位大神把加法、转载 2017-02-17 11:32:56 · 521 阅读 · 0 评论