Tag: Bitwise operators

  • Data Structures & Algorithms in Java – Binary – Reverse Bits

    Problem: Given a number , reverse the bits in that number Input: 00000010100101000001111010011100 Output: 00111001011110000010100101000000 Since in Java the above binary number will be represented as an integer , the output should be 964176192 which is the decimal equivalent of the above binary number Assumptions: The input is stored in 32 bits (which is the…