0:00
The adjacency.
00:12
So basically you have all the neighbors.
00:18
A neighbor with b and c and d.
00:26
Then b is with neighbor of a, c, and g.
00:51
Then you have e, uh, d, d has neighbor a and c.
01:00
Uh, e has neighbor of b and h.
01:07
Um, f has neighbor g and h.
01:16
G has neighbor b, h and f.
01:34
H has neighbor e, f.
01:39
And g all right so with that thing we let's go ahead and then work on the breath first search bfs it always start with at a and q neighbors in the phabetic order and also i will mark when in queued so let's say when look at b fs you start with a and in q b cd this is what we're we have here.
02:36
Then dqb.
02:50
You visit b and in q e and g.
03:06
C and a already visited and in q.
03:09
So.
03:10
So from there you can see that the next one is dqc.
03:22
You visit c.
03:24
C has neighbor of abd.
03:30
So, a, b, d are already in q'd.
03:34
So there's no new neighbors.
03:52
And then you dqd, visit d.
04:07
Again, d has neighbor a and c already in q.
04:12
No new neighbor.
04:16
Then you dqe, visit e.
04:27
E has neighboring b and h.
04:32
B is already in q, so in qh.
04:43
The next one, dequeuing g.
04:58
So g has neighbor of b, f in h.
05:03
So visit g.
05:08
So b and h are already in q, so you would want to in q f.
05:26
Then you have dqh.
05:28
H.
05:39
H has enabled e, f, g.
05:43
So if you look at that, e, f, and g, they're all already in q.
05:51
So no new neighbor.
06:04
Last one, dqf.
06:09
F has neighbor of g and h.
06:16
Visit f.
06:19
This is at the end.
06:21
Done.
06:26
So you start with a, you end with f.
06:31
So from there, the bfs visit order is going to be a, b, c, d, e, g, h, and f.
06:43
So here is the bfs search tree from parent to children.
06:48
So you can see a would split to c and d and also b...