Draw a representation of the adjacency matrix and adjacency list for the following directed graph. (the stars represent arrows)
(2)
* \
/ | \
/ | *
(1)-------------* (4)
\ | *
\ | |
\ |
| \ |
| * |
| (6) |
* |
(3)--------* (5)
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | |||
| 2 | 1 | 1 | ||||
| 3 | 1 | |||||
| 4 | ||||||
| 5 | 1 | |||||
| 6 |
List
| Vertex | List |
|---|---|
| 1 | 2-->4-->6 |
| 2 | 3-->4 |
| 3 | 5 |
| 4 | |
| 5 | 4 |
| 6 |