How to write pesoduocode for following graph !
Figure 23.2 http://staff.ustc.edu.cn/~csli/graduate/algorithms/book6/chap23.htm here what I have
// adj-list
for each u ∈ v [G]
do empty list Adj-list[u]
for each u ∈ v [G]
do if (u,v) ∈ E //if there is edge between u,v
then add v to Adj-list [u]
but i don't know how to deal with the directed edge any help please? the second one
//adj-matrix
for i=1 to n
for j=1 to n
if (i,j)∈ E
adj-matrix [i][j]=1
else adj-matrix [i][j]=0