We make a list of the letters and their frequencies in the message MISSION SUCCESSFUL, including the space. S=5; I=U=C=2; M=O=N=space=E=F=L=1. The number after the equals sign gives the "weight", the frequency of the letter(s). The next step is to make a tree with the highest frequency letters near the top of the tree and the lowest at the bottom. These are the leaves. The idea is to find an optimal binary code that is shortest for the highest frequency letter and longest for the lowest. The branches of the tree bifurcate to two "child" branches we call left and right. Left is denoted on the code by a zero and right by a 1. We start at the base of the tree with all the letters with a frequency of 1. We group them into pairs. Since there are seven we take three pairs: FL, spE, ON and join each pair to a "node", which is simply a point where each letter branches off to the left or right. We give the node the combined weight of the letters that branch off from it. So for ON, spE and FL the combined weight is 2. So we have three nodes. We take a pair of these (spE node and FL node) and create another node that joins them. What we can do now is create another node that joins the spare ON node and the spare letter M.
We end up with a type of family tree where at each node including the topmost, we have exactly two children at every node. In this tree there is only one "parent" per pair of "children", a sort of monogenesis. Each child can only parent two children. At the end of the generation chain are the letters, the leaves of the tree.
To find out which unique code each letter is associated with we use the digit 1 when we branch to the right and 0 if we branch to the left. Here are the codes I came up with.
S=0, C=110, I=1110, U=1111, M=1000, F=10010, L=10011, space=10100, E=10101, O=10110, N=10111. The message is these codes following one another in sequence, so it goes:
1000|1110|0|0|1110|10110|10111|10100|0|1111|110|110|10101|0|0|10010|1111|10011
The vertical bar has been inserted for legibility; it isn't part of the code. This is not the only way the message can be encoded, and the decoding depends on the receiver possessing the tree from which the codes are derived.