Hello everyone, I rewrote huffmandeco() from the communications package. The one in communications 1.1.0 uses a brute-force O(n^3) or O(n^4) solution. I implemented it using a binary tree and now takes O(n) operations (please note that I am not used to big O notation and numbers may be off). I attached the function and another one used to convert the dictionary to a tree to this mail.
There's another related function, huffmandict(), that initializes two cell arrays like this: list{1:L} = [ ]; Octave complains when this is found in 3.2.4 and 3.4.3. I don't know if it is possible to initialize cell arrays like that or if it used to be, as the function dates to 2006. I used list = cell(1,L); instead and now works without problem. My sourceforge username is vodkano. This is my first contribution to libre software and i feel great! Ferran
dict2tree.m
Description: Binary data
huffmandeco.m
Description: Binary data
------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d
_______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev