Huffman from vector to array