How can we represent Trees?
### Edge List
We can use an **edge list** as one form of representation of a tree.

Pros:
* Very fast to iterate over, cheap to store
Cons:
* storing a tree in a list lacks the structure to efficiently query all the neighbors of a node
### Adjacency List
]
In this representation we store a mapping between a node and all of its neighbors. For example, above we see that node 4 has neighbors 1, 5 and 8, and node 4 is mapped to that neighbor.
### Adjacency Matrix
We can also store a tree as an adjacency matrix of size $N x N$ (where we have $N$ nodes in the tree):

In practice this is rarely done because it is a *huge* waste of space!
---
Links to: [Trees](Trees.md)