Question: Algorithms for graphs 1. Let G be an undirected graph with vertices numbered from 1 to 6. G is represented by such adjacency lists: Vertices
Algorithms for graphs
1. Let G be an undirected graph with vertices numbered from 1 to 6. G is represented by such adjacency lists:
| Vertices | Adjacency lists |
| 1 | 4, 6 |
| 2 | 3, 6 |
| 3 | 2, 4, 5 |
| 4 | 1, 3, 5 |
| 5 | 3, 4, 6 |
| 6 | 1, 2, 5 |
- a. Draw adjacency linked lists of G.
2. Which data structure requires less memory, adjacency lists or an adjacency matrix, in each of the following three cases? ( Choose one option and justify your answers.)
a. Adjacency lists; b. Adjacency matrix; c. Insignificant difference in memory sizes;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
