Implement the maxPowerOf2 method, which should return the highest power of 2 that fits into the passed number. The maxPowerOf2 argument can only be a positive integer. Use only the following operations: 1) Bitwise shifts. 2) Bitwise OR. 3) Bitwise AND. 4) Bitwise unary NOT.
Let's find the highest power of 2
You must be signed in to leave a comment
This page doesn't have any comments yet