New answers tagged bitwise
2
votes
A Java program for compressing/decompressing files via Huffman algorithms (version 1.1.1)
random findings:
final classes - what is the advantage?
repeated code (contributes to an overall impression of verbose)
"...
5
votes
A Java program for compressing/decompressing files via Huffman algorithms (version 1.0.0)
Multiple aspects of this implementation of a Huffman encoder and decoder are inefficient.
At the top level, a bit-by-bit tree-walking decoder is inherently slow. Almost every practical decoder uses ...
3
votes
Huffman code builder in Java - computing prefix codes for arbitrary (generic) alphabets - Take II
The HuffmanEncoder is not an encoder. It's a builder that constructs the code table for the symbols based on the weights. An encoder would take input and encode it ...
3
votes
HuffmannEncoder.java - computing prefix codes for arbitrary (generic) alphabets
Minor but, Huffman only has a single n in the name.
But let's move on to how the code words are built, the meat of the algorithm after all.
...
3
votes
HuffmannEncoder.java - computing prefix codes for arbitrary (generic) alphabets
Style
When I look at your formatting in the following snippet, for some reason you have a newline after the first argument to Double.compare, but this line would be ...
1
vote
Computing the smallest number of the form floor(8^N / 7) that is greater or equal to a number
Firstly, there's absolutely no comments for the reader to understand the purpose of this calculation, i.e. what it might be used for. The name getsize() isn't much ...
-2
votes
4
votes
Computing the smallest number of the form floor(8^N / 7) that is greater or equal to a number
As chux said:
Perhaps more research will lead to a no test approach.
I've found this solution, which is indeed C++ instead of C but let's look past that for now:
...
2
votes
Computing the smallest number of the form floor(8^N / 7) that is greater or equal to a number
For fun, consider a tree of depth log2(X_MAX).
Is there a more direct way (loop-free) to compute this number than computing a level and then going back?
A simple binary decision tree with 4 compares....
9
votes
Accepted
Computing the smallest number of the form floor(8^N / 7) that is greater or equal to a number
is there a more direct way?
Look up table
With 32-bit int, level is so limited in range as ...
2
votes
Computing the smallest number of the form floor(8^N / 7) that is greater or equal to a number
0x49249249
consider giving it a name - approximation of the multiplicative inverse of 7 mod the power of 2 that is the least multiple of 3 no less than the number ...
4
votes
Three non-negative integer encoding techniques in Java
As another review says, I'm not convinced [it] is correct. Suitable conviction could be assured by providing actual unit tests. These would differ from the sample usage shown in a number of ways:
...
5
votes
Top 50 recent answers are included
Related Tags
bitwise × 349c++ × 80
c × 74
performance × 59
java × 56
algorithm × 52
python × 46
integer × 43
c# × 36
programming-challenge × 24
javascript × 19
beginner × 18
bitset × 16
python-3.x × 13
array × 13
c++11 × 12
assembly × 11
serialization × 11
comparative-review × 9
strings × 7
.net × 7
image × 7
compression × 7
python-2.x × 6
time-limit-exceeded × 6