1. you should order frequencies of each character.
2. Then, the more often written character should get the shorter length index and the less often written character should has longer length index.
3. Then, you should make huffman tree. For you should generate indexes where each index must not the prefix value of other indexes.
( The way of making huffman tree is simple. You can refer to it on the internet. )
'Papers > algorithm' 카테고리의 다른 글
using call tree with recursive function (0) | 2015.03.21 |
---|---|
병합정렬 ( Merge Sort ) (0) | 2015.02.28 |
print all possible combinations of r elements in a given array of size n (0) | 2015.02.28 |
Quick sort (0) | 2015.02.08 |