Content deleted Content added
sorry for the typos |
I have just remembered a little more |
||
Line 4:
==The algorithm==
Code is represented as a tree structure in which every node has a corresponding weight and a unique number.<br>
Numbers go down, and from
Weights suffice '''sibling property''', if A is parent node of B and node C is child of B, then W(A)<W(B)<W(C).<br> The weight is merely the count of symbols transmited which codes are associated with children of that node.<br>
A set of nodes with same weights make a '''block'''.<br>
Line 36 ⟶ 39:
Start with empty tree.
For '''"a"''' transmit it's binary code.
NYT spawns two child nodes 254 and 255.
Weight for root is now 1.
Now code for '''"a"''', associated with node 255 is 1.
For '''"b"''' transmit 0 for NYT node, then it's binary code.
NYT spawns two child nodes 252 for NYT and 253 for external node.
Increase weights for 253 and 254 and root.
For second '''"b"''' transmit 01.
Go to it's external node 253, we have a block of wights of 1
Future code for 'b' is 1.▼
Future code for '
|