The goal of the prefix coding is to assign codewords to elements of the input alphabet A, so that no codeword is a prefix of another one, and the total length of the encoded message S is minimized. In the case of static prefix coding, symbol frequencies are known in advance.