Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I hope, new tests with 'IllegalArgumentException' as error signal will work.
Random tests ready.
While working, accidentally dropped Blind4Basics' solution into the solutions section (however, with comment), sorry.
I've used it as reference one to adjust tests.
Hello, Toderesa97, need a couple of hours more - do correction in random tests; will update them in a minutes and then write random wrong formatting test. Thank you!
Will rework random tests a little, and write one for non-correct expression format.
I've just published updated version with 'IllegalArgumentException' as error signal, and portions of random tests.
One's else solution is strong enough to pass them.
I'm trying to resolve kata issues and this can break previous solutions, sorry for that.
Would it be convenient to edit in place?
Ready now.
Function signature changed to "uint64_t hamming(int n)".
Published, but not ready yet - will do some testing, about 1 hour else.
Thank you; will correct this issues.
NASM translation
Thank you for reading and answering, it's very helpful for me.
My questions were mostly about real process, when we have transmitter and receiver:
i) how can transmitter use coding table (e.g. a:0, b:10, c:11) provided by receiver?
ii) when transmitter creates one, how can receiver receive that table or re-calculate it self?
Here, serialization is projection Map<Character,String> -> List (e.g. ["a 0", "b 10", "c 11"]).
Encode message: aaaabcc -> 0000101111;
or aaaabcc, ["a 0", "b 10", "c 11"] -> 0000101111
Decode: the inversion of above.
Ok, the description is consistent, and so;
should test system be able to decode result of Huffman.encode("aaaabcc")?
Guess this is not part of kata problem.
I agree with this too.
freq(b+c)=3 is shortly the same as description (Tree construction, "... This node gets reinserted and has the sum of the frequencies of both trees as new frequency.").
Now I work with java translation and try to choose kata api design.
Well, any solution should be able:
a) serialize coding table calculated,
b) encode message;
So, there are 4 methods in kata api, and 2-a), 3) are not the same as haskell variant.
I think, it's more clear how to work with code table, then just 'decode a bit sequence using the given frequencies' (haskell kata description).
For example, a:4, b:1, c:2 (symbol:frequency) "aaaabcc" coding result is
0000101111
- here a:0
, b:10
, c:11
.When "usually we choose
0
for the left branch and1
for the right branch", shouldn't be b:11
, c:01
if a:0
?a=
0
and freq(a)=4 > freq(b+c)=3; so last code letter for c should be the same as first for a, because of freq(c)=2 > freq(b)=1 (in accordance with select branch rule.Whould it be convenient to work with this 1), 2-a), 2-b), 3) api schema in kata java version?
Beta version,
needed a day or two to inspect tests.
Thank you
NASM translation
Not quite sure, am I correct using cr_malloc in Test function (line 145).
Loading more items...