feat: add HuffmanCoding with fail-fast validation and immutable design#7289
Merged
DenizAltunkapan merged 1 commit intoTheAlgorithms:masterfrom Feb 26, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7289 +/- ##
============================================
+ Coverage 79.37% 79.40% +0.02%
- Complexity 7020 7049 +29
============================================
Files 786 787 +1
Lines 23025 23105 +80
Branches 4523 4542 +19
============================================
+ Hits 18276 18346 +70
- Misses 4019 4024 +5
- Partials 730 735 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ce78182 to
a88aa03
Compare
DenizAltunkapan
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the Huffman Coding compression algorithm as requested in #6935.
Key Implementation Details:
PriorityQueue(min-heap) to build the optimal prefix tree.Collections.unmodifiableMapto prevent external tampering.HuffmanCodingTest.java) covering standard usage, edge cases (nulls, empty strings, single characters), Unicode/special characters, and volume stress tests.Complexity Analysis
Closes #6935
clang-format -i --style=file path/to/your/file.java