###### YuqiRealm.com

SUDO -U 更多内容请见：https://github.com/EmilyQiRabbit

###### [leetcode]190. Reverse Bits -- JavaScript 代码
/**
* @param {number} n - a positive integer
* @return {number} - a positive integer
*/
var reverseBits = function(n) {
var result = 0;
for (var i = 0; i < 32; i++) {
result |= (n >> i & 0x1) << (31 - i);
// 取得n特定位的值，设置到result特定位中
}
return result >>> 0;
};

unsigned int a = 3774191835u;
unsigned int b = a >> 2;
/* b == 943547958 */ 

var a = 3774191835;
var b = a >> 2;
/* b == -130193866 */ 

var signed,unsigned;
var signed = -1;
unsigned = signed >>> 0;// 有符号变无符号
signed = unsigned << 0;// 无符号变有符号
alert(signed)

#### 190. Reverse Bits [easy] (Python)

2016-06-18 11:04:11

#### 【LeetCode-190】 Reverse Bits(C++)

2016-05-20 23:11:28

#### 【LeetCode-面试算法经典-Java实现】【190-Reverse Bits（反转二制）】

2015-08-24 07:15:15

#### Leetcode_190_Reverse Bits

2015-07-13 21:33:35

#### LeetCode(190) Reverse Bits

2015-03-22 12:46:11

#### LeetCode 190. Reverse Bits 题解

2017-03-02 11:09:44

#### LeetCode 第 190 题 (Reverse Bits)

2016-04-18 21:31:15

#### leetCode 190-Reverse Bits

2015-04-01 19:11:40

#### 【LeetCode】Reverse Bits 翻转二进制

2015-04-23 14:59:36

#### [leetcode]: 190. Reverse Bits

2017-06-05 14:58:13

## 不良信息举报

[leetcode]190. Reverse Bits -- JavaScript 代码