public void createCode(HuffmanNode node,Map<Character,String> map,StringBuffer buff){
        if(node == null){
            return;
        }
        
        if(node.left == null && node.right == null){
            map.put(node.input,buff.toString());
            return;
        }
        buff.append("0");
        createCode(node.left,map,buff);
        buff.deleteCharAt(buff.length()-1);
        buff.append("1");
        createCode(node.right,map,buff);
        buff.deleteCharAt(buff.length()-1);
    }
http://www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding/
http://www.geeksforgeeks.org/greedy-algorithms-set-3-huffman-coding-set-2/
src/com/interview/tree/HuffmanEncoding.java