﻿1
00:00:00,420 --> 00:00:04,380
‫So now let's look at using an adjacency list.

2
00:00:04,860 --> 00:00:08,970
‫So I'm going to bring up a graph like this to store.

3
00:00:08,970 --> 00:00:13,200
‫Our adjacency list will be using an unordered map.

4
00:00:13,590 --> 00:00:22,620
‫So with our adjacency list to store the vertex A, which has edges with B and E, it would look like

5
00:00:22,620 --> 00:00:23,460
‫this.

6
00:00:23,820 --> 00:00:29,130
‫So in our key value pair, the key is going to be a a string.

7
00:00:29,280 --> 00:00:34,560
‫And the value is going to be what is called an unordered set.

8
00:00:34,950 --> 00:00:40,710
‫And I'll talk a little bit more about what an unordered set is in the next video, if you're not familiar

9
00:00:40,710 --> 00:00:42,120
‫with that for now.

10
00:00:42,240 --> 00:00:47,380
‫Think of this as a vector and then we can just move around this graph.

11
00:00:47,400 --> 00:00:50,370
‫B has edges with A and C.

12
00:00:51,430 --> 00:01:00,430
‫Sea has edges with B and D, D has edges with C and E and E has edges with A and D.

13
00:01:01,030 --> 00:01:06,280
‫So that unordered map on the right represents the graph on the left.

14
00:01:06,670 --> 00:01:12,550
‫So we could use an adjacency matrix or an adjacency list to store our graphs.

15
00:01:12,880 --> 00:01:17,470
‫But in this course, we're going to use an adjacency list.

