Huffman tree
A Huffman tree is a type of binary tree used in data compression. It organizes data based on the frequency of each symbol, allowing more common symbols to have shorter codes and less common symbols to have longer codes. This efficient coding reduces the overall size of the data when stored or transmitted.
The process of creating a Huffman tree involves building a priority queue of nodes, where each node represents a symbol and its frequency. The two nodes with the lowest frequencies are combined to form a new node, and this process continues until only one node remains, which becomes the root of the tree.