thanks for all the help today... gonna give it one more shot than get some sleep can carry on tmr... :)
On to huffman...
Collapse
X
-
ok this is rather interesting but i added a static var(0) and another one x which is = the static var++.Originally posted by KWSWthanks for all the help today... gonna give it one more shot than get some sleep can carry on tmr... :)
somehow it works... was playing on the fact that every time a node is created the value of x would increase from the base value of the static var. than just compare the 2 node's value of x and somehow it works...
dunno how it works but thought i just share it here if anyone else is having the same problem as me. would be nice if someone explains it to me as well...
now to figure out how to encode but its time to sleep... nights and many thanks again to JosAH :)Comment
-
You're welcome of course; as I wrote above: if the frequencies differ all is fine;Originally posted by KWSWok this is rather interesting but i added a static var(0) and another one x which is = the static var++.
somehow it works... was playing on the fact that every time a node is created the value of x would increase from the base value of the static var. than just compare the 2 node's value of x and somehow it works...
dunno how it works but thought i just share it here if anyone else is having the same problem as me. would be nice if someone explains it to me as well...
now to figure out how to encode but its time to sleep... nights and many thanks again to JosAH :)
if they don't you need another (consistent) way to make those nodes different.
Here's a small example: A(1) B(2) B(3) B(4) C(5) C(6) D(7) E(8) etc.
The A, B, C, etc represent the frequencies; where they are equal that serial
number (your static counter) makes the difference for the nodes, so no two
nodes are considered equal and that is just what you need for that set.
kind regards,
JosComment
Comment