Compression of data by the Hofmann method.
This is a rather complex data compression algorithm, which is used in many applications and systems.The program takes the way to the source data file, read the data from the file and creates a dictionary of the frequency of the symbols in the text.Then the program creates a line of priorities for the nodes of the Huffman tree, using symbols from the vocabulary of frequency.Then the program performs the fusion of two nodes with the lowest frequency until the Huffman tree is created.Then the program builds a Hatfman code table for each symbol in the text, using the Hatfman tree.For each symbol the program finds the way in the tree from the root to the leaf and codes the symbol using this path.The program also uses the Hofmann codes to encod the original text.To do this, the program creates a encoded line, replacing each symbol in the original text by the Hofmann code.Then the program adds information about the additional zero, if necessary, that the length of the encoded line was multiplied by 8 bits.This is necessary for the correct recording of the encoded text in binary format.Finally, the program records encoded text in a binary file with the extension ".bin".This file can be used to further restore the original text.In general, this program is a complex data compression algorithm, which can be used to reduce the file size and save proportionally more data in a limited volume of memory or when transmitted through the network.