package top.shares.problems;

/**
 *  reverse bits
 * 
 * @author dongyado<dongyado@gmail.com>
 * */
public class ReverseBits {

}

@@ -30,17 +30,16 @@
 %0A/**%0A * 
- 
 reverse 
@@ -42,16 +42,257 @@
 rse bits
+%0A *  %0A * Reverse bits of a given 32 bits unsigned integer.%0A * %0A * For example, given input 43261596 (represented in binary as 00000010100101000001111010011100),%0A * return 964176192 (represented in binary as 00111001011110000010100101000000).
 %0A * %0A * 
@@ -334,16 +334,17 @@
 %3E%0A * */%0A
+%0A
 public c
@@ -363,10 +363,570 @@
 Bits %7B%0A%0A
+%09public static void main(String%5B%5D args) %0A%09%7B%0A%0A%09%09System.out.println( reverseBits( 2 ));%0A%09%0A%09%7D%0A%09%0A%09public static int reverseBits(int n) %7B%0A        long num = (long)n;%0A%09%09long mask = 0X80000000L;%0A%09%09long f = 0L; %0A%09%09long fmask = 1L;%0A%09%09long flag = 0;%0A%09%09%0A%09%09for ( int i = 0; i %3C 32; i++)%0A%09%09%7B%0A%09%09%09fmask = 1;%0A%09%09%09flag = num & mask;%0A%09%09%09if (flag  %3E 0)%0A%09%09%09%7B%0A%09%09%09%09fmask %3C%3C= i;%0A%09%09%09%09f %7C= fmask;%0A%09%09%09%7D%0A%09%09%09mask %3E%3E= 1;%0A%09%09%7D%0A%09%09return (int)f;%0A    %7D%0A%09%0A%09public static long getUnsignedInt (int num)%0A%09%7B     %0A%09%09//%E5%B0%86int%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2%E4%B8%BA0~4294967295 (0xFFFFFFFF%E5%8D%B3DWORD)%E3%80%82%0A        return num & 0x0FFFFFFFF ;%0A    %7D%0A
 %7D%0A

solve reverse bits