40 Algorithms Every Programmer Should Know
上QQ阅读APP看书,第一时间看更新

Tree

In the context of algorithms, a tree is one of the most useful data structures due to its hierarchical data storage capabilities. While designing algorithms, we use trees wherever we need to represent hierarchical relationships among the data elements that we need to store or process. 

Let's look deeper into this interesting and quite important data structure.

Each tree has a finite set of nodes so that it has a starting data element called a root and a set of nodes joined together by links called branches.