一、(10%) Use Huffman's algorithm to construct an optimal binary prefix code for the letters in the following table.

Letter : A D I M N Y Z

Frequency: 12 7 18 10 9 5 2