Java
Java copied to clipboard
Added Power of Four Check (Bit Manipulation)
Description
This PR adds an implementation to check whether a number is a power of four using bit manipulation.
The algorithm ensures that:
- The number is positive.
- It has exactly one set bit.
- The set bit is at an even position.
Type of change
- [x] New Algorithm / Data Structure
Checklist
- [x] Code follows TheAlgorithms/Java style and package structure
- [x] SpotBugs, Checkstyle, and CodeQL pass successfully
- [x] Added comprehensive JUnit test cases
- [x] Added Javadoc documentation
- [x] Verified output with multiple test examples