Trees are mostly used to represent hierarchical structures like databases and charts. They’re also used when we need to search and index data efficiently, as well as for data compression (i.e. Huffman coding).