Back
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.
Java
Description
Solution
My Code
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.
Example 1:
Input:
43261596
Output:
964176192
Viz
Tests
Run
Input
43261596
4294967293
Custom
43261596
arr =
43261596
Reverse each bit position
n
43261596
0
0
0
0
28
0
0
1
0
24
1
0
0
1
20
0
1
0
0
16
0
0
0
1
12
1
1
1
0
8
1
0
0
1
4
1
1
0
0
0
Variables
Variable
Value
n
43261596
Depth
Function Call
Stack empty
0/9
0.5x
1x
2x
4x