# 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 00111001011110000010100101000000).

class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t res=0;
uint32_t temp=n;
for(int i=0; i<32; i++)
{
if((temp%2)==1)
{
res=res<<1;
res+=1;
}
else
{
res=res<<1;
}
temp=temp>>1;

}
return res;

}
};

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

2016-06-18 11:04:11

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

2016-05-20 23:11:28

#### LeetCode(190) Reverse Bits

2015-03-22 12:46:11

#### Reverse bits of a given 32 bits unsigned integer

2015-10-04 16:29:38

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

2015-08-24 07:15:15

#### LeetCode 190. Reverse Bits 题解

2017-03-02 11:09:44

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

2015-04-23 14:59:36

#### LEETCODE 190

2016-03-11 19:36:13

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

2016-04-18 21:31:15

#### [LeetCode: Python]190. Reverse Bits

2017-05-12 12:14:22