A tree is a hierarchical data structure in which every node is accessed via a unique path that starts at a unique root node. Trees are often used for searching data and optimizing an ordered access to nodes. In the graph theory, a tree is a graph of connect nodes without cycles. Attention: use tag 'trie' for the tree like data structure aiming at string matching (prefix/suffix)
A tree is a hierarchical data structure of nodes and edges. It is build on a unique root node and every node is accessed via a unique path starting from the root.
In the graph theory, a tree is a graph of connect nodes without cycles. There's no special root node in this graph definition, because any node of the graph could be used as root.
A tree structure is by construction recursive: the root has edges to other nodes, which are each the root of a subtree. A node without sub-tree is called a leaf node.
Trees are often used for searching data and optimizing an ordered access to nodes:
- directories of file systems
- search tries
- ordering
Attention: use tag 'trie' for the tree like data structure aiming at string matching (prefix/suffix)