
位运算
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 · 409 阅读 · 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 · 453 阅读 · 0 评论 -
(位运算总结)A summary: how to use bit manipulation to solve problems easily and efficiently
原帖在此 WIKI Bit 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 · 1072 阅读 · 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 · 578 阅读 · 0 评论