題組內容

2.(20%) Hufiman coding

b.(10%) Given a string S which consist of space char and lower case letters (i.e.,', 'a', ...,'2), implement a function huffman_code (str) which can output the huffiman code table which is optimized to the input string S and convert the str into a bit pattem according to the generated hufiman code table.