Skip to content

Conversation

@Shewale41
Copy link

Description

This PR adds an implementation for counting the total number of set bits
from 1 to N using bit manipulation.

The algorithm efficiently counts bits using mathematical observation and avoids
iterating through all numbers, running in O(log N) time.

Type of change

  • New Algorithm/Data Structure

Checklist

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

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 91.93548% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.39%. Comparing base (21eff8a) to head (40561cf).
⚠️ 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    #6996      +/-   ##
============================================
+ Coverage     78.26%   78.39%   +0.12%     
- Complexity     6573     6635      +62     
============================================
  Files           743      748       +5     
  Lines         21895    22077     +182     
  Branches       4288     4331      +43     
============================================
+ Hits          17137    17307     +170     
- 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.

@Shewale41 Shewale41 closed this Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants