In this article, we have explored an efficient algorithm to Reverse bits of an Integer. The challenge is to do this in-place without using auxiliary memory.
Table of contents:
Problem statementAlgorithm to reverse bitsPseudocodeCodeStep by Step ExplanationTime and Space Complexity
Let us get started with Reverse bits of an Integer.
Problem statement
Given a 32 bit unsigned integer N, we have to reverse bits of a the given 32 bits unsigned integer
**Ex: **
lets N = 255 (0b 0000000000000000...
Published on November 18, 2021 23:16