Start writing a simple application for building the tree. The process is pretty strightforward, the initial tree (flat) should be ordered by symbol occurrences, then:
- Remove the the two bottom nodes from the tree, and create a new node having 'occurrences' equal to the sum of the occurrences of the removed ones (and having exactly the 'removed ones' as children).
- Insert the newly created node in the original tree (in the right position to maintain the tree ordered).
Repeat the two above steps until you have a properly single rooted tree.
If you have troubles in doing this, the you may post your doubts here.