func (n *Node) Code() (r uint64, bits byte) {
	for parent := n.Parent; parent != nil; n, parent = parent, parent.Parent {
		if parent.Right == n {  
			r |= 1 << bits
		}  
		bits++
	}
	return
}
Code returns the Huffman code of the node.
Left children get bit 0, Right children get bit 1.
Implementation uses Node.Parent to walk "up" in the tree.
package huffman
import (
	"fmt"
	"sort"
	"strconv"
)
type ValueType int32
type Node struct {
	Parent *Node      
	Left   *Node      
	Right  *Node      
	Count  int        
	Value  ValueType  
}