Java icon indicating copy to clipboard operation
Java copied to clipboard

Added Power of Four Check (Bit Manipulation)

Open Shewale41 opened this issue 1 month ago • 2 comments

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

Shewale41 avatar Oct 30 '25 16:10 Shewale41