Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added Power of Four Check (Bit Manipulation) #6999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Shewale41 wants to merge 8 commits into TheAlgorithms:master
base: master
Choose a base branch
Loading
from Shewale41:add-power-of-four

Conversation

@Shewale41
Copy link
Contributor

@Shewale41 Shewale41 commented Oct 30, 2025
edited
Loading

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

  • New Algorithm / Data Structure

Checklist

  • Code follows TheAlgorithms/Java style and package structure
  • SpotBugs, Checkstyle, and CodeQL pass successfully
  • Added comprehensive JUnit test cases
  • Added Javadoc documentation
  • Verified output with multiple test examples

Copy link

Codecov Report

❌ Patch coverage is 92.06349% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.39%. Comparing base (21eff8a) to head (f58388c).
⚠️ 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 ⚠️
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 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor Author

Hey @DenizAltunkapan @yanglbme @alxkm 👋 can you please review this PR , I have cleared all the checks can you merge my PR.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@DenizAltunkapan DenizAltunkapan Awaiting requested review from DenizAltunkapan DenizAltunkapan is a code owner

@yanglbme yanglbme Awaiting requested review from yanglbme yanglbme is a code owner

@alxkm alxkm Awaiting requested review from alxkm alxkm is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /