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
Codecov Report
:x: Patch coverage is 92.06349% with 5 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 78.39%. Comparing base (21eff8a) to head (f58388c).
:warning: Report is 5 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...ithms/datastructures/trees/ThreadedBinaryTree.java | 90.19% | 2 Missing and 3 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #6999 +/- ##
============================================
+ Coverage 78.26% 78.39% +0.12%
- Complexity 6573 6639 +66
============================================
Files 743 749 +6
Lines 21895 22078 +183
Branches 4288 4331 +43
============================================
+ Hits 17137 17308 +171
- Misses 4074 4080 +6
- Partials 684 690 +6
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Hey @DenizAltunkapan @yanglbme @alxkm 👋 can you please review this PR , I have cleared all the checks can you merge my PR. Thanks.