From 9ab0b0d2aa3412c804b6b29c889bc1a7f3ce6ca3 Mon Sep 17 00:00:00 2001 From: James Bowes Date: Wed, 5 Sep 2012 12:40:18 -0300 Subject: [PATCH] Add a note about not including the parent node into the huffman coding. --- ALGORITHM.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ALGORITHM.md b/ALGORITHM.md index cafe109..4a3cf4d 100644 --- a/ALGORITHM.md +++ b/ALGORITHM.md @@ -129,7 +129,9 @@ path strings themselves (to avoid collision). Next, we order the nodes from the above DAG by order of reference from other nodes, from least to most references. This ensures the root of the DAG is always first, as it has no references. Similar to the strings, we create a -huffman tree for the nodes. +huffman tree for the nodes. The root node should not be included in the huffman +tree, as it is never referenced by any other nodes, so we don't need to use up +any potential address space on it. We can then iterate over the node list, writing each one out to the binary packing. Within each node, for each string and node pair that it references, we