Tree is a data structure that could look like in real life tree. See 202112102054# on how to traverse a tree.
Tree can be used for:
- directory structure
There are several implementations of tree:
Characteristics
- N nodes = root + (N - 1) edges
- Every node except root must have one parent
- Path of length 0 is the path the node lead to itself
- Exactly one path exists for root to every node
Analysis
- Most methods could result in \(O(\log N)\)