Let's look at some of the useful tactics of the Bitwise Operators Divide a number by 2 n=n>>1; Multiply a number by 2 n=n<<1; Count total bits in a number // if n =5 and binary representation is 101 //TotalBits=3 TotalBits = log2(n)+1; Swapping Two ...

Markdown supported · ⌘↵ to post
No responses yet.